mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Fix bosch alarm areas not correctly subscribing to alarms (#146322)
* Fix bosch alarm areas not correctly subscribing to alarms * add test
This commit is contained in:
parent
fd30dd0aee
commit
9a6ebb0848
@ -50,7 +50,7 @@ class AreaAlarmControlPanel(BoschAlarmAreaEntity, AlarmControlPanelEntity):
|
|||||||
|
|
||||||
def __init__(self, panel: Panel, area_id: int, unique_id: str) -> None:
|
def __init__(self, panel: Panel, area_id: int, unique_id: str) -> None:
|
||||||
"""Initialise a Bosch Alarm control panel entity."""
|
"""Initialise a Bosch Alarm control panel entity."""
|
||||||
super().__init__(panel, area_id, unique_id, False, False, True)
|
super().__init__(panel, area_id, unique_id, True, False, True)
|
||||||
self._attr_unique_id = self._area_unique_id
|
self._attr_unique_id = self._area_unique_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -66,6 +66,16 @@ async def test_update_alarm_device(
|
|||||||
|
|
||||||
assert hass.states.get(entity_id).state == AlarmControlPanelState.ARMED_AWAY
|
assert hass.states.get(entity_id).state == AlarmControlPanelState.ARMED_AWAY
|
||||||
|
|
||||||
|
area.is_triggered.return_value = True
|
||||||
|
|
||||||
|
await call_observable(hass, area.alarm_observer)
|
||||||
|
|
||||||
|
assert hass.states.get(entity_id).state == AlarmControlPanelState.TRIGGERED
|
||||||
|
|
||||||
|
area.is_triggered.return_value = False
|
||||||
|
|
||||||
|
await call_observable(hass, area.alarm_observer)
|
||||||
|
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
ALARM_CONTROL_PANEL_DOMAIN,
|
ALARM_CONTROL_PANEL_DOMAIN,
|
||||||
SERVICE_ALARM_DISARM,
|
SERVICE_ALARM_DISARM,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user