Move icon constants to entity attributes (#90518)
* Move icon constants to attribute * Adjust test
This commit is contained in:
parent
2e0ecf9bd9
commit
d0c38c1e12
29 changed files with 46 additions and 177 deletions
|
@ -27,8 +27,6 @@ from . import KNOWN_DEVICES
|
|||
from .connection import HKDevice
|
||||
from .entity import HomeKitEntity
|
||||
|
||||
ICON = "mdi:security"
|
||||
|
||||
CURRENT_STATE_MAP = {
|
||||
0: STATE_ALARM_ARMED_HOME,
|
||||
1: STATE_ALARM_ARMED_AWAY,
|
||||
|
@ -72,6 +70,7 @@ async def async_setup_entry(
|
|||
class HomeKitAlarmControlPanelEntity(HomeKitEntity, AlarmControlPanelEntity):
|
||||
"""Representation of a Homekit Alarm Control Panel."""
|
||||
|
||||
_attr_icon = "mdi:security"
|
||||
_attr_supported_features = (
|
||||
AlarmControlPanelEntityFeature.ARM_HOME
|
||||
| AlarmControlPanelEntityFeature.ARM_AWAY
|
||||
|
@ -86,11 +85,6 @@ class HomeKitAlarmControlPanelEntity(HomeKitEntity, AlarmControlPanelEntity):
|
|||
CharacteristicsTypes.BATTERY_LEVEL,
|
||||
]
|
||||
|
||||
@property
|
||||
def icon(self) -> str:
|
||||
"""Return icon."""
|
||||
return ICON
|
||||
|
||||
@property
|
||||
def state(self) -> str:
|
||||
"""Return the state of the device."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue