mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Adjust config entry state checks in nest (#138912)
This commit is contained in:
parent
08358514b4
commit
c7169a4ed7
@ -7,7 +7,6 @@ from collections.abc import Mapping
|
|||||||
from google_nest_sdm.device import Device
|
from google_nest_sdm.device import Device
|
||||||
from google_nest_sdm.device_traits import ConnectivityTrait, InfoTrait
|
from google_nest_sdm.device_traits import ConnectivityTrait, InfoTrait
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntryState
|
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers import device_registry as dr
|
from homeassistant.helpers import device_registry as dr
|
||||||
from homeassistant.helpers.device_registry import DeviceInfo
|
from homeassistant.helpers.device_registry import DeviceInfo
|
||||||
@ -84,8 +83,7 @@ def async_nest_devices(hass: HomeAssistant) -> Mapping[str, Device]:
|
|||||||
"""Return a mapping of all nest devices for all config entries."""
|
"""Return a mapping of all nest devices for all config entries."""
|
||||||
return {
|
return {
|
||||||
device.name: device
|
device.name: device
|
||||||
for config_entry in hass.config_entries.async_entries(DOMAIN)
|
for config_entry in hass.config_entries.async_loaded_entries(DOMAIN)
|
||||||
if config_entry.state == ConfigEntryState.LOADED
|
|
||||||
for device in config_entry.runtime_data.device_manager.devices.values()
|
for device in config_entry.runtime_data.device_manager.devices.values()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user