homebridge-edomoticz 2.1.46 → 2.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/domoticz.js +4 -4
- package/lib/domoticz_accessory.js +5 -4
- package/package.json +1 -1
package/lib/domoticz.js
CHANGED
|
@@ -33,7 +33,7 @@ Domoticz.settings = function(accessory, completion, error) {
|
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
var url = accessory.platform.apiBaseURL + "type=
|
|
36
|
+
var url = accessory.platform.apiBaseURL + "type=command¶m=getsettings";
|
|
37
37
|
baseHttpRequest.get({
|
|
38
38
|
url: url
|
|
39
39
|
}, function(err, response, json) {
|
|
@@ -59,7 +59,7 @@ Domoticz.devices = function(baseURL, roomID, completion, error) {
|
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
var url = baseURL + "type=
|
|
62
|
+
var url = baseURL + "type=command¶m=getdevices&used=true&order=Name";
|
|
63
63
|
if (roomID) {
|
|
64
64
|
url += "&plan=" + roomID;
|
|
65
65
|
}
|
|
@@ -102,7 +102,7 @@ Domoticz.hardware = function(baseURL, completion, error) {
|
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
var url = baseURL + "type=
|
|
105
|
+
var url = baseURL + "type=command¶m=gethardware";
|
|
106
106
|
|
|
107
107
|
baseHttpRequest.get({
|
|
108
108
|
url: url
|
|
@@ -133,7 +133,7 @@ Domoticz.deviceStatus = function(accessory, completion, error) {
|
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
var url = accessory.platform.apiBaseURL + "type=
|
|
136
|
+
var url = accessory.platform.apiBaseURL + "type=command¶m=getdevices&rid=" + accessory.idx;
|
|
137
137
|
baseHttpRequest.get({
|
|
138
138
|
url: url
|
|
139
139
|
}, function(err, response, json) {
|
|
@@ -600,7 +600,7 @@ eDomoticzAccessory.prototype = {
|
|
|
600
600
|
url = this.platform.apiBaseURL + "type=command¶m=udevice&idx=" + this.idx;
|
|
601
601
|
url = url + "&nvalue=0&svalue=" + setpoint;
|
|
602
602
|
} else if (this.subType == "Zone") {
|
|
603
|
-
url = this.platform.apiBaseURL + "type=setused&idx=" + this.idx + "&setpoint=";
|
|
603
|
+
url = this.platform.apiBaseURL + "type=command¶m=setused&idx=" + this.idx + "&setpoint=";
|
|
604
604
|
url = url + setpoint + "&mode=PermanentOverride&used=true";
|
|
605
605
|
}
|
|
606
606
|
this.platform.log("Setting thermostat SetPoint to " + setpoint);
|
|
@@ -633,9 +633,9 @@ eDomoticzAccessory.prototype = {
|
|
|
633
633
|
var sArray = Helper.sortByKey(json.result, "Name");
|
|
634
634
|
sArray.map(function (s) {
|
|
635
635
|
var heat = (this.Type == "Heating" && this.subType == "Zone") ? true : false;
|
|
636
|
-
var therm = (this.Type == "Thermostat" && this.subType == "SetPoint") ? true : false;
|
|
636
|
+
var therm = (this.Type == "Thermostat" && this.subType == "SetPoint" || this.Type == "Setpoint") ? true : false;
|
|
637
637
|
temp = (heat || therm) ? Helper.oneDP(Helper.cleanFloat(s.SetPoint)) : Helper.oneDP(Helper.cleanFloat(s.Temp));
|
|
638
|
-
url = this.platform.apiBaseURL + "type=setused&idx=" + this.idx + "&setpoint=";
|
|
638
|
+
url = this.platform.apiBaseURL + "type=command¶m=setused&idx=" + this.idx + "&setpoint=";
|
|
639
639
|
url = url + temp + "&mode=" + mode;
|
|
640
640
|
url = (mode == "TemporaryOverride") ? url + "&until=" + isonow + "&used=true" : url + "&used=true";
|
|
641
641
|
this.platform.log("Setting thermostat SetPoint to " + temp + ", mode to " + mode);
|
|
@@ -1500,6 +1500,7 @@ eDomoticzAccessory.prototype = {
|
|
|
1500
1500
|
var service = this.getService(Service.LightSensor);
|
|
1501
1501
|
var lightSensorCharacteristic = this.getCharacteristic(service, Characteristic.CurrentAmbientLightLevel);
|
|
1502
1502
|
var val9 = Helper.cleanFloat(message.svalue1);
|
|
1503
|
+
val9 = (val9 == 0) ? 0.0001 : val9;
|
|
1503
1504
|
callback(lightSensorCharacteristic, val9);
|
|
1504
1505
|
break;
|
|
1505
1506
|
} else if (this.subType == "Waterflow") {
|
|
@@ -2222,7 +2223,7 @@ eDomoticzAccessory.prototype = {
|
|
|
2222
2223
|
this.services.push(rainService);
|
|
2223
2224
|
break;
|
|
2224
2225
|
}
|
|
2225
|
-
case this.Type == "Heating" || this.Type == "Thermostat":
|
|
2226
|
+
case this.Type == "Heating" || this.Type == "Thermostat" || this.Type == "Setpoint":
|
|
2226
2227
|
{
|
|
2227
2228
|
var HeatingDeviceService = this.getService(Service.Thermostat);
|
|
2228
2229
|
if (!HeatingDeviceService) {
|