From 1bcc38c2963b56751e5d68de2f3e244c80caf9f7 Mon Sep 17 00:00:00 2001 From: Nebz <28622481+NebzHB@users.noreply.github.com> Date: Sat, 20 Jan 2024 10:26:16 +0100 Subject: [PATCH] Update index.js --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 7db7df2..72a2def 100755 --- a/index.js +++ b/index.js @@ -511,6 +511,7 @@ JeedomPlatform.prototype.AccessoireCreateHomebridge = function(eqLogic) { Serv.eqLogic=eqLogic; Serv.actions={}; Serv.infos={}; + Serv.infos.moving=null; if(cmd.moving) { Serv.infos.moving=cmd.moving; } @@ -739,6 +740,7 @@ JeedomPlatform.prototype.AccessoireCreateHomebridge = function(eqLogic) { Serv.actions={}; Serv.infos={}; Serv.infos.state=cmd.state; + Serv.infos.moving=null; if(cmd.moving) { Serv.infos.moving=cmd.moving; } @@ -4584,7 +4586,7 @@ JeedomPlatform.prototype.getAccessoryValue = function(characteristic, service, i } break; case Characteristic.PositionState.UUID : - if(moving in service.infos) { + if(moving in service.infos && service.infos.moving !== null) { for (const cmd of cmdList) { if (cmd.generic_type == 'FLAP_MOVING' || cmd.generic_type == 'WINDOW_MOVING') { switch(parseInt(cmd.currentValue)) {