126 files
This commit is contained in:
@@ -328,12 +328,12 @@ def fleet_excluded_entities(hass: HomeAssistant) -> set[str]:
|
||||
Inlined lookup (not via battery_fleet_setup.find_fleet_entry) to keep this
|
||||
module import-cycle-free — setup imports the aggregation, not vice versa.
|
||||
"""
|
||||
from ..const import CONF_OBJECT, DOMAIN
|
||||
from ..const import BATTERY_FLEET_EXCLUDED, BATTERY_FLEET_OBJECT_FLAG, CONF_OBJECT, DOMAIN
|
||||
|
||||
for entry in hass.config_entries.async_entries(DOMAIN):
|
||||
obj = entry.data.get(CONF_OBJECT, {})
|
||||
if obj.get("battery_fleet"):
|
||||
return set(obj.get("battery_fleet_excluded") or [])
|
||||
if obj.get(BATTERY_FLEET_OBJECT_FLAG):
|
||||
return set(obj.get(BATTERY_FLEET_EXCLUDED) or [])
|
||||
return set()
|
||||
|
||||
|
||||
@@ -357,7 +357,10 @@ def _is_self_charging(hass: HomeAssistant, device_id: str | None) -> bool:
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
device = dr.async_get(hass).async_get(device_id)
|
||||
if device and any(domain == "mobile_app" for domain, _ in device.identifiers):
|
||||
# #127: identifiers are typed (domain, id) but the registry doesn't enforce
|
||||
# it — NissanConnect ships 3-element tuples, and strict unpacking took the
|
||||
# whole fleet down. Only the domain matters here.
|
||||
if device and any(ident[0] == "mobile_app" for ident in device.identifiers):
|
||||
return True
|
||||
for reg_entry in er.async_entries_for_device(er.async_get(hass), device_id, include_disabled_entities=True):
|
||||
if reg_entry.domain in ("vacuum", "lawn_mower"):
|
||||
|
||||
Reference in New Issue
Block a user