Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
NebzHB authored Jun 3, 2024
1 parent 1525d1f commit 19e8962
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3175,7 +3175,23 @@ JeedomPlatform.prototype.setAccessoryValue = function(value, characteristic, ser
}
}
}
this.command(value == 0 ? 'turnOff' : 'turnOn', null, service);
if(value == 0) {
if(service.actions.off) {
this.command('turnOff', null, service);
} else if(service.actions.slider && service.LightType) {
this.command('setValueBright', 0, service);
} else {
this.command('turnOff', null, service);
}
else {
if(service.actions.on) {
this.command('turnOn', null, service);
} else if(service.actions.slider && service.LightType) {
this.command('setValueBright', service.maxBright, service);
} else {
this.command('turnOn', null, service);
}
}
}
break;
case Characteristic.Active.UUID :
Expand Down

0 comments on commit 19e8962

Please sign in to comment.