Skip to content

Commit

Permalink
fixed validation error. see: home-assistant/core/issues/118668
Browse files Browse the repository at this point in the history
  • Loading branch information
nidble committed Jun 10, 2024
1 parent ad3938e commit b7f9367
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions custom_components/inim/alarm_control_panel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Support for INIM Alarm Control Panels."""

from collections.abc import Mapping
from functools import cached_property
import logging

# from aiohttp import ClientError
Expand Down Expand Up @@ -106,6 +107,18 @@ def __init__(
sw_version=version,
)

@cached_property
def code_arm_required(self) -> bool:
"""Whether the code is required for arm actions."""

"""
This fix validation error introduced by:
https://github.com/home-assistant/core/issues/118668
For further details please look at
https://github.com/home-assistant/core/blob/dev/homeassistant/components/alarm_control_panel/__init__.py#L184C1-L188C1
"""
return False # or self._attr_code_arm_required

@property
def state(self) -> StateType:
"""Return the state of the entity."""
Expand Down Expand Up @@ -153,3 +166,9 @@ async def _async_arm(self, state: str):
_LOGGER.info(
f"INIM alarm panel is going to be updated with: {state}/{self._scenarios[state]}" # noqa: G004
)

# see daikin integration, async_schedule_update_ha_state
# await self.async_device_update()
# self.async_write_ha_state()
# await self.async_update_ha_state()
# self.async_schedule_update_ha_state(True)
2 changes: 1 addition & 1 deletion custom_components/inim/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"requirements": [
"pyinim==0.0.18"
],
"version": "0.1.18"
"version": "0.1.19"
}

0 comments on commit b7f9367

Please sign in to comment.