nielsfaber/alarmo

New alarm control panel state property and state enum (new as of Home Assistant Core 2024.11)

Opened this issue ยท 8 comments

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 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

More details can be found in the alarm control panel documentation.

Checklist

  • I checked for similar existing requests (both open and closed) before posting.
  • My request is generic, other users may benefit from it too.

Proposal

[clear description of what you want to see changed or added]

Additional info

[some example of how the new functionality should look like]

Thanks for the heads-up, I will adopt this in the upcoming release.

There's more that will break in 2024.11

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

@tomlut

There's more that will break in 2024.11

You mean 2025.11 ๐Ÿ™‚

I could have sworn I double checked that was 2024 ๐Ÿคฆโ€โ™‚๏ธ

Would you like me to open a separate issue?

Also the names of the notifications are ordered by name. The newly added notifications always appears at the end of the list.
The workaround lets you to save the notification.

Hedda commented

Also the names of the notifications are ordered by name. The newly added notifications always appears at the end of the list.
The workaround lets you to save the notification.

FYI, sounds like there is ongoing work to rewrite notify, see architecture discussion and PR links here:

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

tomlut commented

Still an issue.