forked from ysimonx/node-red-contrib-melcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmelcloud-connect.html
128 lines (120 loc) · 4.23 KB
/
melcloud-connect.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<script type="text/javascript">
RED.nodes.registerType('melcloud-credential',{
category: 'config',
defaults: {
email: {value:"user@domain.com",required:true},
password: {value:"password",required:true},
},
label: function() {
return "credentials for " + this.email;
}
});
</script>
<script type="text/html" data-template-name="melcloud-credential">
<div class="form-row">
<label for="node-config-input-email"><i class="fa fa-bookmark"></i> Email</label>
<input type="text" id="node-config-input-email">
</div>
<div class="form-row">
<label for="node-config-input-password"><i class="fa fa-bookmark"></i> Password</label>
<input type="text" id="node-config-input-password">
</div>
</script>
<script type="text/javascript">
RED.nodes.registerType("melcloud-device", {
category: "input",
color: "#ffcc66",
defaults: {
server: {value:"", type:"melcloud-credential", required: true},
buildingid: { value:"" },
deviceid: { value:""},
mode: { value:"", required: false},
power: { value:"", required: false},
settemperature: { value:"", required: false, validate:RED.validators.regex(/[0-9\.]*/) },
setfanspeed: { value:"", required: false, validate:RED.validators.regex(/[0-9]*/) }
},
inputs: 1,
outputs: 1,
icon: "feed.png",
label: function() {
return "melcloud-device : " + this.deviceid ;
}
});
</script>
<script type="text/x-red" data-template-name="melcloud-device">
<div class="form-row">
<label for="node-input-server"><i class="fa fa-globe"></i> Credentials</label>
<input type="text" id="node-input-server" />
</div>
<div class="form-row">
<label for="node-input-buildingid"><i class="fa fa-building"></i> BuildingID</label>
<input type="text" id="node-input-buildingid" />
</div>
<div class="form-row">
<label for="node-input-deviceid"><i class="fa fa-slideshare"></i> DeviceID</label>
<input type="text" id="node-input-deviceid" />
</div>
<div class="form-row">
<label for="node-input-mode"><i class="fa fa-recycle"></i> Mode</label>
<select id="node-input-mode">
<option value=""></option>
<option value="auto">Auto</option>
<option value="dry">Dry</option>
<option value="heat">Heat</option>
<option value="fan">Fan</option>
<option value="cooling">Cooling</option>
</select>
</div>
<div class="form-row">
<label for="node-input-power"><i class="fa fa-power-off"></i> Power</label>
<select id="node-input-power">
<option value=""></option>
<option value="on">On</option>
<option value="off">Off</option>
</select>
</div>
<div class="form-row">
<label for="node-input-settemperature"><i class="fa fa-thermometer-half"></i> Set Temperature C°</label>
<input type="text" id="node-input-settemperature" />
</div>
<div class="form-row">
<label for="node-input-setfanspeed"><i class="fa fa-tachometer"></i> Set Fan Speed</label>
<select id="node-input-setfanspeed">
<option value=""></option>
<option value="0">0 : Auto</option>
<option value="1">1 : Lowest</option>
<option value="2">2 : Low</option>
<option value="3">3 : Medium</option>
<option value="4">4 : High</option>
<option value="5">5 : Max</option>
</select>
</div>
</script>
<script type="text/javascript">
RED.nodes.registerType("melcloud-connect", {
category: "input",
color: "#ffcc66",
defaults: {
server: {value:"", type:"melcloud-credential", required: true},
command: { value:"" },
},
inputs: 1,
outputs: 1,
icon: "feed.png",
label: function() {
return "melcloud-connect";
}
});
</script>
<script type="text/x-red" data-template-name="melcloud-connect">
<div class="form-row">
<label for="node-input-server"><i class="fa fa-globe"></i> Credentials</label>
<input type="text" id="node-input-server" />
</div>
<div class="form-row">
<label for="node-input-command"><i class="fa fa-terminal"></i> Command</label>
<select id="node-input-command">
<option value="getListDevices">Devices list</option>
</select>
</div>
</script>