Use EntityFeature enum in components (p**) (#69434)
This commit is contained in:
parent
b8fc399882
commit
80a857c6c2
12 changed files with 137 additions and 206 deletions
|
@ -5,10 +5,7 @@ from pyprosegur.auth import Auth
|
|||
from pyprosegur.installation import Installation, Status
|
||||
|
||||
import homeassistant.components.alarm_control_panel as alarm
|
||||
from homeassistant.components.alarm_control_panel import (
|
||||
SUPPORT_ALARM_ARM_AWAY,
|
||||
SUPPORT_ALARM_ARM_HOME,
|
||||
)
|
||||
from homeassistant.components.alarm_control_panel import AlarmControlPanelEntityFeature
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
STATE_ALARM_ARMED_AWAY,
|
||||
|
@ -43,6 +40,11 @@ async def async_setup_entry(
|
|||
class ProsegurAlarm(alarm.AlarmControlPanelEntity):
|
||||
"""Representation of a Prosegur alarm status."""
|
||||
|
||||
_attr_supported_features = (
|
||||
AlarmControlPanelEntityFeature.ARM_AWAY
|
||||
| AlarmControlPanelEntityFeature.ARM_HOME
|
||||
)
|
||||
|
||||
def __init__(self, contract: str, auth: Auth) -> None:
|
||||
"""Initialize the Prosegur alarm panel."""
|
||||
self._changed_by = None
|
||||
|
@ -53,7 +55,6 @@ class ProsegurAlarm(alarm.AlarmControlPanelEntity):
|
|||
|
||||
self._attr_name = f"contract {self.contract}"
|
||||
self._attr_unique_id = self.contract
|
||||
self._attr_supported_features = SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_HOME
|
||||
|
||||
async def async_update(self):
|
||||
"""Update alarm status."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue