Skip to content

Commit

Permalink
Merge pull request #200 from NebzHB/removeMoving
Browse files Browse the repository at this point in the history
Remove moving
  • Loading branch information
NebzHB authored Jan 29, 2024
2 parents 9d134aa + c29b5cf commit 418ed4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 35 deletions.
32 changes: 3 additions & 29 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"');}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 :
Expand Down
6 changes: 0 additions & 6 deletions lib/jeedom-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 418ed4d

Please sign in to comment.