made current_scene more explicit

This commit is contained in:
John Lancaster
2024-01-21 10:53:55 -06:00
parent f00421d273
commit e973205b06

View File

@@ -206,7 +206,9 @@ class RoomController(Hass, Mqtt):
return self.states[0] return self.states[0]
async def current_scene(self, time: time = None) -> Dict[str, Dict[str, str | int]]: 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: state = await self.current_state(time=time)
assert isinstance(state, RoomState)
self.log(f'Current scene: {state}')
return state.scene return state.scene
async def app_entity_states(self) -> Dict[str, str]: async def app_entity_states(self) -> Dict[str, str]: