From e03ef3b37a50d0be8d360a091b651c83a276b1f3 Mon Sep 17 00:00:00 2001 From: TheJulianJES Date: Sun, 7 Jul 2024 18:48:50 +0200 Subject: [PATCH] Add `is_on` property to siren (#63) --- zha/application/platforms/siren.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zha/application/platforms/siren.py b/zha/application/platforms/siren.py index 553f15fc9..b5ddace12 100644 --- a/zha/application/platforms/siren.py +++ b/zha/application/platforms/siren.py @@ -113,9 +113,14 @@ def info_object(self) -> SirenEntityInfo: def state(self) -> dict[str, Any]: """Get the state of the siren.""" response = super().state - response["state"] = self._attr_is_on + response["state"] = self.is_on return response + @property + def is_on(self) -> bool: + """Return true if the entity is on.""" + return self._attr_is_on + async def async_turn_on(self, **kwargs: Any) -> None: """Turn on siren.""" if self._off_listener: