mirror of
https://github.com/sudoxnym/fin-assistant.git
synced 2026-04-14 11:37:38 +00:00
Merge pull request #4 from sudoxnym/fix-jellyfin-setup-error-and-deprecations.2025-09-15.06-04-26
Update Jellyfin integration for latest HA API
This commit is contained in:
commit
6d480a1575
1 changed files with 21 additions and 2 deletions
|
|
@ -195,7 +195,15 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry):
|
|||
hass.data[DOMAIN][config.get(CONF_URL)][platform] = {}
|
||||
hass.data[DOMAIN][config.get(CONF_URL)][platform]["entities"] = []
|
||||
|
||||
|
||||
if hasattr(hass.config_entries, "async_forward_entry_setups"):
|
||||
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
|
||||
else:
|
||||
for platform in PLATFORMS:
|
||||
hass.async_create_task(
|
||||
hass.config_entries.async_forward_entry_setup(config_entry, platform)
|
||||
)
|
||||
|
||||
|
||||
async_dispatcher_send(hass, SIGNAL_STATE_UPDATED)
|
||||
|
||||
|
|
@ -210,7 +218,18 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry):
|
|||
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry):
|
||||
_LOGGER.info("Unloading jellyfin")
|
||||
|
||||
unload_ok = await hass.config_entries.async_unload_platforms(config_entry, PLATFORMS)
|
||||
|
||||
if hasattr(hass.config_entries, "async_unload_platforms"):
|
||||
unload_ok = await hass.config_entries.async_unload_platforms(
|
||||
config_entry, PLATFORMS
|
||||
)
|
||||
else:
|
||||
unload_ok = True
|
||||
for platform in PLATFORMS:
|
||||
unload_ok = unload_ok and await hass.config_entries.async_forward_entry_unload(
|
||||
config_entry, platform
|
||||
)
|
||||
|
||||
|
||||
_jelly: JellyfinClientManager = hass.data[DOMAIN][config_entry.data.get(CONF_URL)]["manager"]
|
||||
await _jelly.stop()
|
||||
|
|
|
|||
Loading…
Reference in a new issue