mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Add arming/disarming state to Verisure (#90577)
This commit is contained in:
parent
4f54e33f67
commit
23372e8bc4
@ -9,6 +9,7 @@ from homeassistant.components.alarm_control_panel import (
|
|||||||
CodeFormat,
|
CodeFormat,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
from homeassistant.const import STATE_ALARM_ARMING, STATE_ALARM_DISARMING
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -83,18 +84,24 @@ class VerisureAlarm(
|
|||||||
|
|
||||||
async def async_alarm_disarm(self, code: str | None = None) -> None:
|
async def async_alarm_disarm(self, code: str | None = None) -> None:
|
||||||
"""Send disarm command."""
|
"""Send disarm command."""
|
||||||
|
self._attr_state = STATE_ALARM_DISARMING
|
||||||
|
self.async_write_ha_state()
|
||||||
await self._async_set_arm_state(
|
await self._async_set_arm_state(
|
||||||
"DISARMED", self.coordinator.verisure.disarm(code)
|
"DISARMED", self.coordinator.verisure.disarm(code)
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_alarm_arm_home(self, code: str | None = None) -> None:
|
async def async_alarm_arm_home(self, code: str | None = None) -> None:
|
||||||
"""Send arm home command."""
|
"""Send arm home command."""
|
||||||
|
self._attr_state = STATE_ALARM_ARMING
|
||||||
|
self.async_write_ha_state()
|
||||||
await self._async_set_arm_state(
|
await self._async_set_arm_state(
|
||||||
"ARMED_HOME", self.coordinator.verisure.arm_home(code)
|
"ARMED_HOME", self.coordinator.verisure.arm_home(code)
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_alarm_arm_away(self, code: str | None = None) -> None:
|
async def async_alarm_arm_away(self, code: str | None = None) -> None:
|
||||||
"""Send arm away command."""
|
"""Send arm away command."""
|
||||||
|
self._attr_state = STATE_ALARM_ARMING
|
||||||
|
self.async_write_ha_state()
|
||||||
await self._async_set_arm_state(
|
await self._async_set_arm_state(
|
||||||
"ARMED_AWAY", self.coordinator.verisure.arm_away(code)
|
"ARMED_AWAY", self.coordinator.verisure.arm_away(code)
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user