From 30fe50c80b74bf2816d1a646d3daaa7dd472bc8b Mon Sep 17 00:00:00 2001 From: Nebz <28622481+NebzHB@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:33:49 +0100 Subject: [PATCH 1/2] Update index.js --- index.js | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/index.js b/index.js index e807601..f38eb82 100755 --- a/index.js +++ b/index.js @@ -604,8 +604,6 @@ JeedomPlatform.prototype.AccessoireCreateHomebridge = function(eqLogic) { Serv.infos.HorTiltState = cmd2.HorTiltState; } else if (cmd2.VerTiltState) { Serv.infos.VerTiltState = cmd2.VerTiltState; - } else if(cmd2.moving) { - Serv.infos.moving=cmd2.moving; } }); if(Serv.actions.up && !Serv.actions.down) {that.log('warn','Pas de type générique "Action/Volet Bouton Descendre"');} @@ -800,8 +798,6 @@ JeedomPlatform.prototype.AccessoireCreateHomebridge = function(eqLogic) { Serv.actions.down = cmd2.down; } else if (cmd2.slider) { Serv.actions.slider = cmd2.slider; - } else if(cmd2.moving) { - Serv.infos.moving=cmd2.moving; } }); Serv.maxValue = 100; // if not set in Jeedom it's 100 @@ -3123,7 +3119,7 @@ JeedomPlatform.prototype.configureAccessory = function(accessory) { // -- Return : nothing JeedomPlatform.prototype.bindCharacteristicEvents = function(characteristic, service) { try{ - this.updateSubscriptions.push({service, characteristic}); + if (characteristic.UUID != Characteristic.PositionState.UUID) {this.updateSubscriptions.push({service, characteristic});} if (characteristic.props.perms.includes('pw')) { characteristic.on('set', (value, callback, context) => { if (context !== 'fromJeedom' && context !== 'fromSetValue') { // from Homekit @@ -4622,30 +4618,8 @@ JeedomPlatform.prototype.getAccessoryValue = function(characteristic, service, i } break; case Characteristic.PositionState.UUID : - 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)) { - case 0 : - returnValue=Characteristic.PositionState.DECREASING; - break; - case 1 : - returnValue=Characteristic.PositionState.INCREASING; - break; - case 2 : - returnValue=Characteristic.PositionState.STOPPED; - break; - default : - returnValue=Characteristic.PositionState.STOPPED; - break; - } - that.log('debug','---------update PositionState:',returnValue); - break; - } - } - } else { - returnValue = Characteristic.PositionState.STOPPED; - } + returnValue = Characteristic.PositionState.STOPPED; + break; case Characteristic.CurrentHorizontalTiltAngle.UUID : case Characteristic.TargetHorizontalTiltAngle.UUID : From c29b5cfe6cff9ab0fee6a6760c44ab28f644f10c Mon Sep 17 00:00:00 2001 From: Nebz <28622481+NebzHB@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:34:09 +0100 Subject: [PATCH 2/2] Update jeedom-api.js --- lib/jeedom-api.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/jeedom-api.js b/lib/jeedom-api.js index f31c6c4..ea21d50 100755 --- a/lib/jeedom-api.js +++ b/lib/jeedom-api.js @@ -606,9 +606,6 @@ JeedomClient.prototype.ParseGenericType = function(EqLogic, cmds) { case 'FLAP_STOP' : initServ(result_cmd,'flap','stop',cmd); break; - case 'FLAP_MOVING' : - initServ(result_cmd,'flap','moving',cmd); - break; case 'FLAP_HOR_TILT_STATE' : initServ(result_cmd,'flap','HorTiltState',cmd); break; @@ -634,9 +631,6 @@ JeedomClient.prototype.ParseGenericType = function(EqLogic, cmds) { case 'WINDOW_SLIDER' : initServ(result_cmd,'windowMoto','slider',cmd); break; - case 'WINDOW_MOVING' : - initServ(result_cmd,'windowMoto','moving',cmd); - break; /** ************* THERMOSTAT ***********************/ case 'THERMOSTAT_STATE' : initServ(result_cmd,'thermostat','state',cmd);