From e973205b067c291d1e46c8c533081f1f5537b338 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Sun, 21 Jan 2024 10:53:55 -0600 Subject: [PATCH] made current_scene more explicit --- room_control.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/room_control.py b/room_control.py index 2e36dc5..152418b 100755 --- a/room_control.py +++ b/room_control.py @@ -206,8 +206,10 @@ class RoomController(Hass, Mqtt): return self.states[0] async def current_scene(self, time: time = None) -> Dict[str, Dict[str, str | int]]: - if (state := (await self.current_state(time=time))) is not None: - return state.scene + state = await self.current_state(time=time) + assert isinstance(state, RoomState) + self.log(f'Current scene: {state}') + return state.scene async def app_entity_states(self) -> Dict[str, str]: states = {