2
0

fix(subdevice): filter on sid

This commit is contained in:
Pierre CLEMENT
2018-02-19 22:36:15 +01:00
parent ee19899d9d
commit 83090c4338

View File

@@ -9,6 +9,7 @@ export default (RED:Red, type:string) => {
constructor(props:NodeProperties) {
RED.nodes.createNode(<any> this, props);
this.gateway = RED.nodes.getNode((<any> props).gateway);
this.sid = (<any> props).sid;
(<any> this).status({fill:"grey", shape:"ring", text:"battery - na"});
@@ -19,7 +20,7 @@ export default (RED:Red, type:string) => {
// Input from gateway
if (payload.sid) {
if (payload.sid == this.sid) {
let batteryLevel = payload.getBatteryPercentage();
let batteryLevel = payload.batteryLevel;
var status:NodeStatus = {
fill: "green", shape: "dot",
text: "battery - " + batteryLevel + "%"