fixed a bug where the effects were not updated
This commit is contained in:
parent
913580aec2
commit
c56caf3de8
@ -184,8 +184,19 @@ class HCMagicHome extends HCColorLamp {
|
||||
//console.log(status);
|
||||
|
||||
futureState.on = status.on;
|
||||
|
||||
let effect = (status.mode != 'color' && status.mode != 'warm_white' && status.mode != 'special') ? status.mode : 'none';
|
||||
if(effect != 'none') {
|
||||
let speed = (status.speed > 80) ? 'fast' : (status.speed > 30) ? 'medium' : 'slow';
|
||||
futureState.effect = speed + '-' + effect;
|
||||
} else {
|
||||
futureState.effect = 'none';
|
||||
}
|
||||
|
||||
if (futureState.effect == 'none') { // only update color when no effects are playing
|
||||
futureState.brightness = extractBrightness(status.color);
|
||||
futureState.color = RGB_to_HSL(removeBrightness(status.color));
|
||||
}
|
||||
|
||||
if (currentState.hash != futureState.hash) {
|
||||
// the state of the controller has changed externally
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hc-magichome",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "Magic Home Plugin for Homecontrol",
|
||||
"main": "HCMagicHome.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user