From 3df58e1f798e1fedb664aeb9f8b042ca8308158b Mon Sep 17 00:00:00 2001 From: hkrogh Date: Wed, 20 Nov 2024 11:25:27 +0100 Subject: [PATCH 1/2] Fix SUPPORT_PLAY_MEDIA deprecated warning Fix SUPPORT_PLAY_MEDIA deprecated warning, which will be removed in HA Core 2025.10 --- .../blueiris/helpers/advanced_configurations_generator.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/custom_components/blueiris/helpers/advanced_configurations_generator.py b/custom_components/blueiris/helpers/advanced_configurations_generator.py index eedeb9f..638db30 100644 --- a/custom_components/blueiris/helpers/advanced_configurations_generator.py +++ b/custom_components/blueiris/helpers/advanced_configurations_generator.py @@ -3,7 +3,6 @@ import yaml -from homeassistant.components.media_player import SUPPORT_PLAY_MEDIA from homeassistant.core import HomeAssistant from homeassistant.util import slugify @@ -192,7 +191,7 @@ def _set_input_select_cast_devices( name = state.name supported_features = state.attributes.get("supported_features", 0) - support_play_media = bool(supported_features & SUPPORT_PLAY_MEDIA) + support_play_media = bool(supported_features & MediaPlayerEntityFeature.PLAY_MEDIA) if support_play_media: options.append(name) @@ -264,7 +263,7 @@ def _set_script_cast( name = state.name supported_features = state.attributes.get("supported_features", 0) - support_play_media = bool(supported_features & SUPPORT_PLAY_MEDIA) + support_play_media = bool(supported_features & MediaPlayerEntityFeature.PLAY_MEDIA) if support_play_media: media_player_item = f"""{name}"": ""{entity_id}""" From 77f931d779d90b6ddc78cfefbc103cd3bf233056 Mon Sep 17 00:00:00 2001 From: hkrogh Date: Wed, 20 Nov 2024 11:27:03 +0100 Subject: [PATCH 2/2] Fix warning async_forward_entry_setup Fix warning async_forward_entry_setup, which is deprecated and will stop working in Home Assistant 2025.6 --- custom_components/blueiris/managers/home_assistant.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/custom_components/blueiris/managers/home_assistant.py b/custom_components/blueiris/managers/home_assistant.py index 68a10fa..28a6800 100644 --- a/custom_components/blueiris/managers/home_assistant.py +++ b/custom_components/blueiris/managers/home_assistant.py @@ -115,10 +115,7 @@ async def async_init(self, entry: ConfigEntry): _LOGGER.error(f"Failed to async_init, error: {ex}, line: {line_number}") async def _async_init(self): - load = self._hass.config_entries.async_forward_entry_setup - - for domain in SIGNALS: - await load(self._config_manager.config_entry, domain) + await self._hass.config_entries.async_forward_entry_setups(self._config_manager.config_entry, list(SIGNALS.keys())) self._is_initialized = True