You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of Home Assistant Core 2024.11, we have introduced the alarm_state property in the AlarmControlPanelEntity. This newly added property should be used instead of directly setting the state property.
The new alarm_state property should return its state using the new AlarmControlPanelState enum instead of as previously, setting the state using the STATE_ALARM_* constants.
There is a one-year deprecation period, and the constants will stop working from 2025.11 to ensure all custom integration authors have time to adjust.
Example:
from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity, AlarmControlPanelState
class MyAlarm(AlarmControlPanelEntity):
"""My alarm."""
@property
def alarm_state(self) -> AlarmControlPanelState | None:
"""Return the state of the alarm."""
if self.device.is_on():
return AlarmControlPanelState.ARMED_AWAY
return AlarmControlPanelState.DISARMED
Logger: homeassistant.const
Source: helpers/deprecation.py:222
First occurred: 12:28:37 (36 occurrences)
Last logged: 12:28:37
STATE_ALARM_ARMED_VACATION was used from alarmo, this is a deprecated constant which will be removed in HA Core 2025.11. Use AlarmControlPanelState.ARMED_VACATION instead, please report it to the author of the 'alarmo' custom integration
STATE_ALARM_DISARMED was used from alarmo, this is a deprecated constant which will be removed in HA Core 2025.11. Use AlarmControlPanelState.DISARMED instead, please report it to the author of the 'alarmo' custom integration
STATE_ALARM_TRIGGERED was used from alarmo, this is a deprecated constant which will be removed in HA Core 2025.11. Use AlarmControlPanelState.TRIGGERED instead, please report it to the author of the 'alarmo' custom integration
STATE_ALARM_PENDING was used from alarmo, this is a deprecated constant which will be removed in HA Core 2025.11. Use AlarmControlPanelState.PENDING instead, please report it to the author of the 'alarmo' custom integration
STATE_ALARM_ARMING was used from alarmo, this is a deprecated constant which will be removed in HA Core 2025.11. Use AlarmControlPanelState.ARMING instead, please report it to the author of the 'alarmo' custom integration
New from the Home Assistant Developer Docs is news about "New alarm control panel state property and state enum":
As of Home Assistant Core 2024.11, we have introduced the
alarm_state
property in theAlarmControlPanelEntity
. This newly added property should be used instead of directly setting thestate
property.The new
alarm_state
property should return its state using the newAlarmControlPanelState
enum instead of as previously, setting the state using theSTATE_ALARM_*
constants.There is a one-year deprecation period, and the constants will stop working from 2025.11 to ensure all custom integration authors have time to adjust.
Example:
More details can be found in the alarm control panel documentation.
Checklist
Proposal
[clear description of what you want to see changed or added]
Additional info
[some example of how the new functionality should look like]
The text was updated successfully, but these errors were encountered: