From faea29a268dbdd09edbf557a09b8a43810eaca7b Mon Sep 17 00:00:00 2001 From: Olen Date: Fri, 2 Dec 2022 09:58:29 +0100 Subject: [PATCH] Fix twinkly effects (#83104) Adding additional checks --- homeassistant/components/twinkly/light.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/twinkly/light.py b/homeassistant/components/twinkly/light.py index cc2270f25e1..8f8e8218d87 100644 --- a/homeassistant/components/twinkly/light.py +++ b/homeassistant/components/twinkly/light.py @@ -288,11 +288,13 @@ class TwinklyLight(LightEntity): async def async_update_movies(self) -> None: """Update the list of movies (effects).""" movies = await self._client.get_saved_movies() - if "movies" in movies: + _LOGGER.debug("Movies: %s", movies) + if movies and "movies" in movies: self._movies = movies["movies"] async def async_update_current_movie(self) -> None: """Update the current active movie.""" current_movie = await self._client.get_current_movie() - if "id" in current_movie: + _LOGGER.debug("Current movie: %s", current_movie) + if current_movie and "id" in current_movie: self._current_movie = current_movie