From 8cf1a95bab0304bc1c6ffdc557c119e694b8f2fa Mon Sep 17 00:00:00 2001 From: ultratoto14 <3328573+ultratoto14@users.noreply.github.com> Date: Wed, 31 Mar 2021 19:32:10 +0200 Subject: [PATCH] Fix error that happens when in custom scene (#291) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * FIx error that happens when in custom scene * Remove unnecessary None * Remove unnecessary None Co-authored-by: Pierre Ståhl --- custom_components/localtuya/light.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/localtuya/light.py b/custom_components/localtuya/light.py index d0d7c67..49fade8 100644 --- a/custom_components/localtuya/light.py +++ b/custom_components/localtuya/light.py @@ -273,7 +273,7 @@ class LocaltuyaLight(LocalTuyaEntity, LightEntity): def __find_scene_by_scene_data(self, data): return next( - (item for item in self._effect_list if self._scenes[item] == data), + (item for item in self._effect_list if self._scenes.get(item) == data), SCENE_CUSTOM, )