mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Adjust config entry state check in vizio (#138905)
This commit is contained in:
parent
73442e8443
commit
f828b4e0b9
@ -5,7 +5,7 @@ from __future__ import annotations
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.components.media_player import MediaPlayerDeviceClass
|
from homeassistant.components.media_player import MediaPlayerDeviceClass
|
||||||
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_DEVICE_CLASS, Platform
|
from homeassistant.const import CONF_DEVICE_CLASS, Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.storage import Store
|
from homeassistant.helpers.storage import Store
|
||||||
@ -39,12 +39,9 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
|
|||||||
unload_ok = await hass.config_entries.async_unload_platforms(
|
unload_ok = await hass.config_entries.async_unload_platforms(
|
||||||
config_entry, PLATFORMS
|
config_entry, PLATFORMS
|
||||||
)
|
)
|
||||||
# Exclude this config entry because its not unloaded yet
|
|
||||||
if not any(
|
if not any(
|
||||||
entry.state is ConfigEntryState.LOADED
|
entry.data[CONF_DEVICE_CLASS] == MediaPlayerDeviceClass.TV
|
||||||
and entry.entry_id != config_entry.entry_id
|
for entry in hass.config_entries.async_loaded_entries(DOMAIN)
|
||||||
and entry.data[CONF_DEVICE_CLASS] == MediaPlayerDeviceClass.TV
|
|
||||||
for entry in hass.config_entries.async_entries(DOMAIN)
|
|
||||||
):
|
):
|
||||||
hass.data[DOMAIN].pop(CONF_APPS, None)
|
hass.data[DOMAIN].pop(CONF_APPS, None)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user