mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Remove force from async_schedule_update_ha_state for HMIPC (#31796)
* remove force from async_schedule_update_ha_state if HMIPC * Fix lint
This commit is contained in:
parent
ebeab7f44c
commit
2f3ab15268
@ -16,6 +16,7 @@ from homeassistant.const import (
|
||||
STATE_ALARM_DISARMED,
|
||||
STATE_ALARM_TRIGGERED,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.typing import HomeAssistantType
|
||||
|
||||
from . import DOMAIN as HMIPC_DOMAIN
|
||||
@ -95,10 +96,18 @@ class HomematicipAlarmControlPanel(AlarmControlPanel):
|
||||
"""Register callbacks."""
|
||||
self._home.on_update(self._async_device_changed)
|
||||
|
||||
@callback
|
||||
def _async_device_changed(self, *args, **kwargs) -> None:
|
||||
"""Handle device state changes."""
|
||||
_LOGGER.debug("Event %s (%s)", self.name, CONST_ALARM_CONTROL_PANEL_NAME)
|
||||
self.async_schedule_update_ha_state(True)
|
||||
# Don't update disabled entities
|
||||
if self.enabled:
|
||||
_LOGGER.debug("Event %s (%s)", self.name, CONST_ALARM_CONTROL_PANEL_NAME)
|
||||
self.async_schedule_update_ha_state()
|
||||
else:
|
||||
_LOGGER.debug(
|
||||
"Device Changed Event for %s (Alarm Control Panel) not fired. Entity is disabled.",
|
||||
self.name,
|
||||
)
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
|
@ -31,6 +31,9 @@ async def _async_manipulate_security_zones(
|
||||
internal_zone = home.search_group_by_id(internal_zone_id)
|
||||
internal_zone.active = internal_active
|
||||
|
||||
home.from_json(json)
|
||||
home._get_functionalHomes(json)
|
||||
home._load_functionalChannels()
|
||||
home.fire_update_event(json)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user