Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
NebzHB authored Jan 28, 2024
1 parent a42c2d2 commit 49038bc
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3141,7 +3141,7 @@ JeedomPlatform.prototype.bindCharacteristicEvents = function(characteristic, ser
readOnly = false;
}
}
this.subscribeUpdate(service, characteristic);
this.updateSubscriptions.push({ service, characteristic });

Check failure on line 3144 in index.js

View workflow job for this annotation

GitHub Actions / build (18.x)

There should be no space after '{'

Check failure on line 3144 in index.js

View workflow job for this annotation

GitHub Actions / build (18.x)

There should be no space before '}'

Check failure on line 3144 in index.js

View workflow job for this annotation

GitHub Actions / build (20.x)

There should be no space after '{'

Check failure on line 3144 in index.js

View workflow job for this annotation

GitHub Actions / build (20.x)

There should be no space before '}'

Check failure on line 3144 in index.js

View workflow job for this annotation

GitHub Actions / build (21.x)

There should be no space after '{'

Check failure on line 3144 in index.js

View workflow job for this annotation

GitHub Actions / build (21.x)

There should be no space before '}'
if (!readOnly) {
characteristic.on('set', function(value, callback, context) {
if (context !== 'fromJeedom' && context !== 'fromSetValue') { // from Homekit
Expand Down Expand Up @@ -5640,29 +5640,6 @@ JeedomPlatform.prototype.command = function(action, value, service) {
}
};

// -- subscribeUpdate
// -- Desc : Populate the subscriptions to the characteristic. if the value is changed, the characteristic will be updated
// -- Params --
// -- service : service containing the characteristic to subscribe to
// -- characteristic : characteristic to subscribe to
// -- Return : nothing
JeedomPlatform.prototype.subscribeUpdate = function(service, characteristic) {
try{
if (characteristic.UUID == Characteristic.PositionState.UUID) {
return;
}
this.updateSubscriptions.push({
'service' : service,
'characteristic' : characteristic,
});
}
catch(e){
this.log('error','Erreur de la fonction subscribeUpdate :',e);
console.error(e.stack);
hasError=true;
}
};

// -- startPollingUpdate
// -- Desc : Get the last status from Jeedom and act on it (update model and subscribers)
// -- Params --
Expand Down Expand Up @@ -5720,7 +5697,7 @@ JeedomPlatform.prototype.startPollingUpdate = function() {
};

// -- updateSubscribers
// -- Desc : update subcribers populated by the subscribeUpdate method
// -- Desc : update subcribers in updateSubscriptions array
// -- Params --
// -- update : the update received from Jeedom
// -- Return : nothing
Expand Down

0 comments on commit 49038bc

Please sign in to comment.