Add supported_features to Alarm Control Panel to limit device_actions (#29065)
* Add supported_features to Alarm Control Panel * mark supported_features abstract * Add SF to async_register_entity_service * fix test * Add missing SF SUPPORT_ALARM_ARM_CUSTOM_BYPASS * isort * fix async_register_entity_service * Update alarm_control_panel.py
This commit is contained in:
parent
3203cba01f
commit
1fde0d18ed
35 changed files with 449 additions and 66 deletions
|
@ -4,6 +4,11 @@ import logging
|
|||
import voluptuous as vol
|
||||
|
||||
import homeassistant.components.alarm_control_panel as alarm
|
||||
from homeassistant.components.alarm_control_panel.const import (
|
||||
SUPPORT_ALARM_ARM_AWAY,
|
||||
SUPPORT_ALARM_ARM_HOME,
|
||||
SUPPORT_ALARM_ARM_NIGHT,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
ATTR_CODE,
|
||||
STATE_ALARM_ARMED_AWAY,
|
||||
|
@ -122,6 +127,11 @@ class AlarmDecoderAlarmPanel(alarm.AlarmControlPanel):
|
|||
"""Return the state of the device."""
|
||||
return self._state
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Return the list of supported features."""
|
||||
return SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_NIGHT
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue