Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

Commit 6a72a87

Browse files
shbatmclaude
andauthored
Use native booleans in extra_state_attributes instead of string coercions (#121)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: skynet <tim@bond.casa>
1 parent 6020f19 commit 6a72a87

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

custom_components/isy994/entity.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from typing import Any, TypeAlias, cast
66

7-
from homeassistant.const import STATE_OFF, STATE_ON
87
from homeassistant.core import callback
98
from homeassistant.exceptions import HomeAssistantError
109
from homeassistant.helpers.entity import DeviceInfo, Entity, EntityDescription
@@ -81,7 +80,7 @@ class ISYGroupEntity(ISYEntity):
8180
@property
8281
def extra_state_attributes(self) -> dict:
8382
"""Get the state attributes for the device."""
84-
return {"group_all_on": STATE_ON if self._node.group_all_on else STATE_OFF}
83+
return {"group_all_on": self._node.group_all_on}
8584

8685

8786
class ISYNodeEntity(ISYEntity):
@@ -222,7 +221,7 @@ def extra_state_attributes(self) -> dict:
222221
attr = {}
223222
if self._actions:
224223
actions_detail = cast(ProgramDetail, self._actions.detail)
225-
attr["actions_enabled"] = str(self._actions.enabled)
224+
attr["actions_enabled"] = self._actions.enabled
226225
if actions_detail.last_finish_time is not None:
227226
attr["actions_last_finished"] = str(
228227
as_local(actions_detail.last_finish_time)
@@ -231,10 +230,10 @@ def extra_state_attributes(self) -> dict:
231230
attr["actions_last_run"] = str(as_local(actions_detail.last_run_time))
232231
if self._actions.last_update is not None:
233232
attr["actions_last_update"] = str(as_local(self._actions.last_update))
234-
attr["run_at_startup"] = str(actions_detail.run_at_startup)
235-
attr["running"] = str(actions_detail.running)
233+
attr["run_at_startup"] = actions_detail.run_at_startup
234+
attr["running"] = actions_detail.running
236235

237-
attr["status_enabled"] = str(self._node.enabled)
236+
attr["status_enabled"] = self._node.enabled
238237
detail = cast(ProgramDetail, self._node.detail)
239238
if detail.last_finish_time is not None:
240239
attr["status_last_finished"] = str(as_local(detail.last_finish_time))

0 commit comments

Comments
 (0)