Skip to content

Commit

Permalink
Update soapclient.js
Browse files Browse the repository at this point in the history
Brilliant work, thanks

Added GetSocketSettings to read socket on/off state
  • Loading branch information
Bananis committed Jan 27, 2016
1 parent d374b6d commit 155567b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/soapclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ exports.off = function () {
return soapAction("SetSocketSettings", "SetSocketSettingsResult", requestBody("SetSocketSettings", controlParameters(1, false)));
};

exports.state = function () {
return soapAction("GetSocketSettings", "OPStatus", requestBody("GetSocketSettings", moduleParameters(1)));
};

exports.consumption = function () {
return soapAction("GetCurrentPowerConsumption", "CurrentConsumption", requestBody("GetCurrentPowerConsumption", moduleParameters(2)));
};
Expand Down Expand Up @@ -243,4 +247,4 @@ function readResponseValue(body, elementName) {
var node = doc.getElementsByTagName(elementName).item(0);
return (node) ? node.firstChild.nodeValue : "ERROR";
}
}
}

0 comments on commit 155567b

Please sign in to comment.