Add 'flash_length' to esphome light async_turn_off (#27214)

flash_length was overlooked when fixing the asyn_turn_on flash attribute. async_turn_off is now fixed with the flash attribute.
This commit is contained in:
CQoute 2019-10-07 06:19:31 +10:30 committed by Martin Hjelmare
parent dae8cd8801
commit 02c983d332

View File

@ -91,7 +91,7 @@ class EsphomeLight(EsphomeEntity, Light):
"""Turn the entity off."""
data = {"key": self._static_info.key, "state": False}
if ATTR_FLASH in kwargs:
data["flash"] = FLASH_LENGTHS[kwargs[ATTR_FLASH]]
data["flash_length"] = FLASH_LENGTHS[kwargs[ATTR_FLASH]]
if ATTR_TRANSITION in kwargs:
data["transition_length"] = kwargs[ATTR_TRANSITION]
await self._client.light_command(**data)