forked from aklambeth/bg-hive-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhotwaterControl.js
53 lines (39 loc) · 985 Bytes
/
hotwaterControl.js
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
var Widget = require('./Widget');
var util = require('util');
var request = require('request');
module.exports = HotWaterControl;
function HotWaterControl(context) {
Widget.call(this, context, "hotwater");
}
util.inherits(HotWaterControl, Widget);
HotWaterControl.prototype.Mode = { "Schedule":"SCHEDULE", "Manual":"MANUAL", "Boost":"BOOST" };
HotWaterControl.prototype.State = { "On":"ON", "Off":"OFF"};
HotWaterControl.prototype.SetState = function(state)
{
var task = {
'controls':{
'PUT':{
'operation':state
}
}
};
this.Call(task);
}
HotWaterControl.prototype.GetState = function(){
var task = {
'controls':{
'GET':{}
}
};
this.Call(task);
}
HotWaterControl.prototype.GetSchedule = function(){
var task = {
'controls':{
'schedule':{
'GET':{}
}
}
};
this.Call(task);
}