fix hue driver not powering off.
This commit is contained in:
@@ -320,7 +320,7 @@ func (b *Bridge) makeCongruentLoop(ctx context.Context) {
|
|||||||
|
|
||||||
// Handle power first
|
// Handle power first
|
||||||
if desired.Power != nil && active.Power != nil && *desired.Power != *active.Power {
|
if desired.Power != nil && active.Power != nil && *desired.Power != *active.Power {
|
||||||
updates["light/"+*lightID] = ResourceUpdate{Power: gentools.Ptr(*active.Power)}
|
updates["light/"+*lightID] = ResourceUpdate{Power: gentools.Ptr(*desired.Power)}
|
||||||
|
|
||||||
newActiveState := activeStates[id]
|
newActiveState := activeStates[id]
|
||||||
newActiveState.Power = gentools.Ptr(*desired.Power)
|
newActiveState.Power = gentools.Ptr(*desired.Power)
|
||||||
@@ -328,7 +328,7 @@ func (b *Bridge) makeCongruentLoop(ctx context.Context) {
|
|||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if active.Power != nil && *active.Power == false {
|
if active.Power != nil && !*active.Power {
|
||||||
// Don't do more with shut-off-light.
|
// Don't do more with shut-off-light.
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user