Fix LIFX light turning on while fading off (#78095)

This commit is contained in:
Anders Melchiorsen 2022-09-09 14:43:54 +02:00 committed by GitHub
parent e332091d76
commit 0a143ac596
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -237,15 +237,10 @@ class LIFXLight(LIFXEntity, LightEntity):
elif power_on:
await self.set_power(True, duration=fade)
else:
if power_on:
await self.set_power(True)
if hsbk:
await self.set_color(hsbk, kwargs, duration=fade)
# The response from set_color will tell us if the
# bulb is actually on or not, so we don't need to
# call power_on if its already on
if power_on and self.bulb.power_level == 0:
await self.set_power(True)
elif power_on:
await self.set_power(True)
if power_off:
await self.set_power(False, duration=fade)