Fix yeelight flash (#37743)

* Fix yeelight flash

* Use cast instead of string comparison

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Xiaonan Shen 2020-07-15 21:51:33 +08:00 committed by GitHub
parent a3174a88f5
commit d37a5cdde5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -651,7 +651,7 @@ class YeelightGenericLight(LightEntity):
def set_flash(self, flash) -> None:
"""Activate flash."""
if flash:
if self._bulb.last_properties["color_mode"] != 1:
if int(self._bulb.last_properties["color_mode"]) != 1:
_LOGGER.error("Flash supported currently only in RGB mode")
return