Skip to main content

Constant deprecations for 2022.5

· One min read

For Home Assistant Core 2022.5, we have deprecated many constants and replaced them with enums.

All SUPPORT_* constants have been deprecated, and are summerised in a previously published blog article.

Additionally, the following constants have been deprecated:

  • Alarm Control Panel

    Deprecated constants:

    • FORMAT_TEXT
    • FORMAT_NUMBER

    Use the new CodeFormat enum instead.

  • Camera

    Deprecated constants:

    • STREAM_TYPE_HLS
    • STREAM_TYPE_WEB_RTC

    Use the new StreamType enum instead.

  • Climate

    Deprecated constants:

    • CURRENT_HVAC_COOL
    • CURRENT_HVAC_DRY
    • CURRENT_HVAC_FAN
    • CURRENT_HVAC_HEAT
    • CURRENT_HVAC_IDLE
    • CURRENT_HVAC_OFF
    • HVAC_MODE_AUTO
    • HVAC_MODE_COOL
    • HVAC_MODE_DRY
    • HVAC_MODE_FAN_ONLY
    • HVAC_MODE_HEAT_COOL
    • HVAC_MODE_HEAT
    • HVAC_MODE_OFF

    Use the new HVACAction and HVACMode enums instead.

  • Light

    Deprecated constants:

    • COLOR_MODE_UNKNOWN
    • COLOR_MODE_ONOFF
    • COLOR_MODE_BRIGHTNESS
    • COLOR_MODE_COLOR_TEMP
    • COLOR_MODE_HS
    • COLOR_MODE_XY
    • COLOR_MODE_RGB
    • COLOR_MODE_RGBW
    • COLOR_MODE_RGBWW
    • COLOR_MODE_WHITE

    Use the new ColorMode enum instead.

ServiceInfo model improvements and deprecations

· One min read

As of Home Assistant Core 2022.6, access to discovery information via the, previously deprecated, dictionary methods have been removed.

This applies to the DhcpServiceInfo, MqttServiceInfo, SsdpServiceInfo, UsbServiceInfo, and ZeroconfServiceInfo instances.

Custom integrations are required to migrate to use the new dataclass properties.

Text-to-speech say service to use media source IDs

· One min read

Starting with Home Assistant 2022.5, the TTS say service will set the media content ID to be a media source URI. These need to be resolved inside the media player using the media source integration.

Previously the TTS integration would set the media content ID to a URL that pointed at Home Assistant and it required no extra work from the media players.

Media players need to support the media source integration as documented here.

Saying goodbye to the time_changed event

· One min read

With Home Assistant Core 0.113, we began transiting to using the asyncio event loop for scheduling events.

With 2022.5, we are excited to announce that this process is now complete. The legacy time_changed event, also known as EVENT_TIME_CHANGED is no longer fired every second. Integrations that listen for all events no longer need to filter out EVENT_TIME_CHANGED. Integrations that run in a separate thread may see slight performance benefits since they will no longer be awakened every second.

With the previous implementation, consumers would subscribe to the time_changed event and check the time every time it fired to see if it was a match. This pattern led to many callbacks where most of the time, the callback would reject the event and continue receiving callbacks until the desired time was reached.

If your custom integration is still relying on listening for time_changed events, it will need to transition to using one of the built-in event helpers, which are, in most cases, a one-line drop-in replacement. For more information, please review the integration documentation on listening for events.

Calendar Data Model improvements and deprecations

· One min read

As of Home Assistant Core 2022.5, CalendarDeviceEntity is deprecated and superseded by CalendarEntity. The new entity has a more well defined data model, and a streamlined websocket API. CalendarDeviceEntity will be removed in a future Home Assistant release and custom components are required to migrate to the new APIs. See the new Calendar Entity developer documentation for details.

Local OAuth2 Updates

· One min read

As of Home Assistant Core 2022.5, integrations that register a config_entry_oauth2_flow.LocalOAuth2Implementation must have a manifest dependency on the auth component.

This is motivated by a broader effort to improve OAuth Application Credentials handling, which required changing how the HTTP endpoint for the OAuth callback is registered.

Deprecating all SUPPORT_* constants

· 2 min read

As of Home Assistant Core 2022.5, all SUPPORT_* constants are deprecated, each entity platform is providing an EntityFeature enum to replace them.

This applies to, the following platforms:

  • Alarm Control Panel

    Deprecated supported feature constants:

    • SUPPORT_ALARM_ARM_AWAY
    • SUPPORT_ALARM_ARM_CUSTOM_BYPASS
    • SUPPORT_ALARM_ARM_HOME
    • SUPPORT_ALARM_ARM_NIGHT
    • SUPPORT_ALARM_ARM_VACATION
    • SUPPORT_ALARM_TRIGGER

    Use the new AlarmControlPanelEntityFeature enum instead.

  • Camera

    Deprecated supported feature constants:

    • SUPPORT_ON_OFF
    • SUPPORT_STREAM

    Use the new CameraEntityFeature enum instead.

  • Cover

    Deprecated supported feature constants:

    • SUPPORT_OPEN
    • SUPPORT_CLOSE
    • SUPPORT_SET_POSITION
    • SUPPORT_STOP
    • SUPPORT_OPEN_TILT
    • SUPPORT_CLOSE_TILT
    • SUPPORT_STOP_TILT
    • SUPPORT_SET_TILT_POSITION

    Use the new CoverEntityFeature enum instead.

  • Climate

    Deprecated supported feature constants:

    • SUPPORT_TARGET_TEMPERATURE
    • SUPPORT_TARGET_TEMPERATURE_RANGE
    • SUPPORT_TARGET_HUMIDITY
    • SUPPORT_FAN_MODE
    • SUPPORT_PRESET_MODE
    • SUPPORT_SWING_MODE
    • SUPPORT_AUX_HEAT

    Use the new ClimateEntityFeature enum instead.

  • Humidifier

    Deprecated supported feature constants:

    • SUPPORT_MODES

    Use the new HumidifierEntityFeature enum instead.

  • Fan

    Deprecated supported feature constants:

    • SUPPORT_SET_SPEED
    • SUPPORT_OSCILLATE
    • SUPPORT_DIRECTION
    • SUPPORT_PRESET_MODE

    Use the new FanEntityFeature enum instead.

  • Light

    Deprecated supported feature constants:

    • SUPPORT_EFFECT
    • SUPPORT_FLASH
    • SUPPORT_TRANSITION

    Use the new LightEntityFeature enum instead.

    Note that the following light constants were already deprecated, thus LightEntityFeature does not provide a replacement for those.

    • SUPPORT_BRIGHTNESS
    • SUPPORT_COLOR_TEMP
    • SUPPORT_COLOR
    • SUPPORT_WHITE_VALUE

    These cases should instead be migrated to the new color modes.

  • Lock

    Deprecated supported feature constants:

    • SUPPORT_OPEN

    Use the new LockEntityFeature enum instead.

  • Media Player

    Deprecated supported feature constants:

    • SUPPORT_PAUSE
    • SUPPORT_SEEK
    • SUPPORT_VOLUME_SET
    • SUPPORT_VOLUME_MUTE
    • SUPPORT_PREVIOUS_TRACK
    • SUPPORT_NEXT_TRACK
    • SUPPORT_TURN_ON
    • SUPPORT_TURN_OFF
    • SUPPORT_PLAY_MEDIA
    • SUPPORT_VOLUME_STEP
    • SUPPORT_SELECT_SOURCE
    • SUPPORT_STOP
    • SUPPORT_CLEAR_PLAYLIST
    • SUPPORT_PLAY
    • SUPPORT_SHUFFLE_SET
    • SUPPORT_SELECT_SOUND_MODE
    • SUPPORT_BROWSE_MEDIA
    • SUPPORT_REPEAT_SET
    • SUPPORT_GROUPING

    Use the new MediaPlayerEntityFeature enum instead.

  • Remote

    Deprecated supported feature constants:

    • SUPPORT_LEARN_COMMAND
    • SUPPORT_DELETE_COMMAND
    • SUPPORT_ACTIVITY

    Use the new RemoteEntityFeature enum instead.

  • Siren

    Deprecated supported feature constants:

    • SUPPORT_DURATION
    • SUPPORT_TONES
    • SUPPORT_TURN_OFF
    • SUPPORT_TURN_ON
    • SUPPORT_VOLUME_SET

    Use the new SirenEntityFeature enum instead.

  • Vacuum

    Deprecated supported feature constants:

    • SUPPORT_TURN_ON
    • SUPPORT_TURN_OFF
    • SUPPORT_PAUSE
    • SUPPORT_STOP
    • SUPPORT_RETURN_HOME
    • SUPPORT_FAN_SPEED
    • SUPPORT_BATTERY
    • SUPPORT_STATUS
    • SUPPORT_SEND_COMMAND
    • SUPPORT_LOCATE
    • SUPPORT_CLEAN_SPOT
    • SUPPORT_MAP
    • SUPPORT_STATE
    • SUPPORT_START

    Use the new VacuumEntityFeature enum instead.

  • Water Heater

    Deprecated supported feature constants:

    • SUPPORT_TARGET_TEMPERATURE
    • SUPPORT_OPERATION_MODE
    • SUPPORT_AWAY_MODE

    Use the new WaterHeaterEntityFeature enum instead.

New features for developers in 2022.4

· 2 min read

There are a handful of new features for developers in 2022.4.

  • Integration Type: Integrations can now mark themselves as helper.
  • Backup platform: Integrations can now pause work during a backup by implementing the new backup platform.
  • hidden_by in entity registry: Entities can now be hidden via the entity registry. These entities should default to not be included when exposing entities to an external UI like voice assistants.
  • New and updated selectors: We added a bunch of new selectors to be used in blueprints, services.yaml, and config flows.
  • Selectors in backend flows: You can now use the selector helper in your config flows. It is configured and renders just like selectors in services.yaml/blueprints.
  • ha-form context: Context is a new way to allow selectors to be dynamically configured based on values from other fields. Currently only available for the attribute selector.
  • config flow helper text for fields: Config flow fields can now have a description.
  • Schema Config Flow helper: New helper to create config flows based on a config schema. Example implementation
  • Show Menu step: This new step in a data entry flow shows a menu to the user.
  • Fan speed: We introduced a new format and this transition is now completed.
  • Device State Attributes: Backwards compatibility support for this property has been removed after being deprecated since Home Assistant 2021.4. Use extra_state_attributes instead.
  • Cameras without width/height: The compatbility layer for cameras without width/height has been removed.
  • Calendar offset: Calendar method signatures for calculate_offset and is_offset_reached have changed, in preparation for typing improvements in Calendar, and potential simplification of offsets more generally.

Introducing the update entity

· 2 min read

Home Assistant 2022.4 will provide a brand new entity platform: the update entity.

The update entity can be provided by integrations to indicate there is an update available, for a device or service, towards the Home Assistant user. It allows you to provide additional information about the update, such as the latest version available, a summary of the release notes and a link to the full release announcement online.

Additionally, the install method can be implemented, so the user can install the update directly from within Home Assistant.

Adding the update platform to your integration is relatively simple to do, as it is just a couple of properties and, if available for the integration, a single install method. Most other details are handled by Home Assistant automatically.

In Home Assistant Core 2021.12 we moved updates provided by the Supervisor to the Configuration panel, using this new platform, we will be able to extend that in the near future by the information provided by these brand new entities.

See our developer documentation for how to implement this in an integration.

If your integration previously provided a binary_sensor or button entity with the update device class, please consider replacing those with the update entity.

Opt in support to manually remove device

· One min read

In the Home Assistant Core 2022.3 release, Erik Montnemery added support for any integration to opt in to show a "delete device" button on the device page in the Home Assistant interface.

See our developer documentation for how to implement this in an integration.

So far five integrations have opted in to this feature:

Why is this needed?

Before this feature was added, integrations were advised to automatically clean up stale devices from the config entry. But not all integrations are able to automatically determine if a device should be removed, so a manual option where the user can make the choice is in some cases still needed.

To solve this need, some integrations had implemented an integration specific websocket command with accompanying frontend support to allow manual removal of a device. With this new feature, integrations do no longer need to add any websocket or frontend code but can easily support, just by implementing the backend callback function, manual device removal.

Happy days!