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, )