diff --git a/src/core/entity.py b/src/core/entity.py index 469da09..3565917 100644 --- a/src/core/entity.py +++ b/src/core/entity.py @@ -22,7 +22,6 @@ class Entity: self._room = room self._device_type = device_type.strip().lower() self._groups = set(groups) - self.__is_on__: bool | None = None @property def id(self) -> str: @@ -52,20 +51,13 @@ class Entity: """Implements an entity specific update operation to get the latest state.""" raise EntityOpNotSupportedError("update") - async def toggle_state(self): - """Turns entity on, if off, and vice versa, if supported.""" - if self.__is_on__ == False: # Neither True nor None - await self.turn_on() - else: - await self.turn_off() - async def turn_on(self): """Turns entity on, if action supported.""" - self.__is_on__ = True # TODO: What if action unsuccessful? + raise EntityOpNotSupportedError("turn_on") async def turn_off(self): """Turns entity on, if action supported.""" - self.__is_on__ = False # TODO: What if action unsuccessful? + raise EntityOpNotSupportedError("turn_off") async def set_brightness(self, brightness: float): """Does not turn an entity on if brightness > 0 and entity turned off."""