mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Fix incorrect RainMachine service helper (#58633)
This commit is contained in:
parent
37a07acce0
commit
2b7fe06b16
@ -127,9 +127,11 @@ def async_get_controller_for_service_call(
|
|||||||
device_registry = dr.async_get(hass)
|
device_registry = dr.async_get(hass)
|
||||||
|
|
||||||
if device_entry := device_registry.async_get(device_id):
|
if device_entry := device_registry.async_get(device_id):
|
||||||
for entry_id in device_entry.config_entries:
|
for entry in hass.config_entries.async_entries(DOMAIN):
|
||||||
if controller := hass.data[DOMAIN][entry_id][DATA_CONTROLLER]:
|
if entry.entry_id in device_entry.config_entries:
|
||||||
return cast(Controller, controller)
|
return cast(
|
||||||
|
Controller, hass.data[DOMAIN][entry.entry_id][DATA_CONTROLLER]
|
||||||
|
)
|
||||||
|
|
||||||
raise ValueError(f"No controller for device ID: {device_id}")
|
raise ValueError(f"No controller for device ID: {device_id}")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user