forked from home-assistant/core
Fix incorrect RainMachine service helper (#58633)
This commit is contained in:
committed by
Paulus Schoutsen
parent
ffe008cbef
commit
da2addf15a
@@ -135,9 +135,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}")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user