Use EntityFeature enum in components (t**) (#69457)
This commit is contained in:
parent
889e1f4442
commit
bbf19582bb
15 changed files with 102 additions and 127 deletions
|
@ -5,11 +5,9 @@ from tuya_iot import TuyaDevice, TuyaDeviceManager
|
|||
|
||||
from homeassistant.backports.enum import StrEnum
|
||||
from homeassistant.components.alarm_control_panel import (
|
||||
SUPPORT_ALARM_ARM_AWAY,
|
||||
SUPPORT_ALARM_ARM_HOME,
|
||||
SUPPORT_ALARM_TRIGGER,
|
||||
AlarmControlPanelEntity,
|
||||
AlarmControlPanelEntityDescription,
|
||||
AlarmControlPanelEntityFeature,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
|
@ -109,13 +107,13 @@ class TuyaAlarmEntity(TuyaEntity, AlarmControlPanelEntity):
|
|||
description.key, dptype=DPType.ENUM, prefer_function=True
|
||||
):
|
||||
if Mode.HOME in supported_modes.range:
|
||||
self._attr_supported_features |= SUPPORT_ALARM_ARM_HOME
|
||||
self._attr_supported_features |= AlarmControlPanelEntityFeature.ARM_HOME
|
||||
|
||||
if Mode.ARM in supported_modes.range:
|
||||
self._attr_supported_features |= SUPPORT_ALARM_ARM_AWAY
|
||||
self._attr_supported_features |= AlarmControlPanelEntityFeature.ARM_AWAY
|
||||
|
||||
if Mode.SOS in supported_modes.range:
|
||||
self._attr_supported_features |= SUPPORT_ALARM_TRIGGER
|
||||
self._attr_supported_features |= AlarmControlPanelEntityFeature.TRIGGER
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue