From c3d313ea883644cb88ed4f32d8a5d4fdfcdfb13c Mon Sep 17 00:00:00 2001 From: root Date: Sun, 13 Aug 2023 23:48:53 -0500 Subject: [PATCH] bug fix when sleep_scene is unset --- room_control.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/room_control.py b/room_control.py index e9bc550..00d06c5 100755 --- a/room_control.py +++ b/room_control.py @@ -161,7 +161,8 @@ class RoomController(Hass): return self.states[-1] def current_scene(self, time: time = None): - return self.current_state(time=time)['scene'] + if (state := self.current_state(time=time)) is not None: + return state['scene'] def gather_app_entities(self) -> List[str]: """Returns a list of all the entities involved in any of the states