Fix Fully Kiosk service call config entry handling (#85275)

* Make sure we're getting the fully_kiosk config entry

* Make sure we're getting the fully_kiosk config entry
This commit is contained in:
Charles Garwood 2023-01-05 22:10:41 -05:00 committed by GitHub
parent bdcccd9d83
commit cf92142b64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,10 +47,19 @@ async def async_setup_services(hass: HomeAssistant) -> None:
for target in call.data[ATTR_DEVICE_ID]:
device = registry.async_get(target)
if device:
coordinator = hass.data[DOMAIN][list(device.config_entries)[0]]
# fully_method(coordinator.fully, *args, **kwargs) would make
# test_services.py fail.
await getattr(coordinator.fully, fully_method.__name__)(*args, **kwargs)
for key in device.config_entries:
entry = hass.config_entries.async_get_entry(key)
if not entry:
continue
if entry.domain != DOMAIN:
continue
coordinator = hass.data[DOMAIN][key]
# fully_method(coordinator.fully, *args, **kwargs) would make
# test_services.py fail.
await getattr(coordinator.fully, fully_method.__name__)(
*args, **kwargs
)
break
async def async_load_url(call: ServiceCall) -> None:
"""Load a URL on the Fully Kiosk Browser."""