Fix Rachio service missing with 1st generation controllers (#55679)
This commit is contained in:
parent
1e4233fe20
commit
9db13a3e74
1 changed files with 11 additions and 11 deletions
|
@ -70,9 +70,6 @@ class RachioPerson:
|
|||
can_pause = True
|
||||
break
|
||||
|
||||
if not can_pause:
|
||||
return
|
||||
|
||||
all_devices = [rachio_iro.name for rachio_iro in self._controllers]
|
||||
|
||||
def pause_water(service):
|
||||
|
@ -97,6 +94,16 @@ class RachioPerson:
|
|||
if iro.name in devices:
|
||||
iro.stop_watering()
|
||||
|
||||
hass.services.async_register(
|
||||
DOMAIN,
|
||||
SERVICE_STOP_WATERING,
|
||||
stop_water,
|
||||
schema=STOP_SERVICE_SCHEMA,
|
||||
)
|
||||
|
||||
if not can_pause:
|
||||
return
|
||||
|
||||
hass.services.async_register(
|
||||
DOMAIN,
|
||||
SERVICE_PAUSE_WATERING,
|
||||
|
@ -111,13 +118,6 @@ class RachioPerson:
|
|||
schema=RESUME_SERVICE_SCHEMA,
|
||||
)
|
||||
|
||||
hass.services.async_register(
|
||||
DOMAIN,
|
||||
SERVICE_STOP_WATERING,
|
||||
stop_water,
|
||||
schema=STOP_SERVICE_SCHEMA,
|
||||
)
|
||||
|
||||
def _setup(self, hass):
|
||||
"""Rachio device setup."""
|
||||
rachio = self.rachio
|
||||
|
@ -134,7 +134,7 @@ class RachioPerson:
|
|||
for controller in devices:
|
||||
webhooks = rachio.notification.get_device_webhook(controller[KEY_ID])[1]
|
||||
# The API does not provide a way to tell if a controller is shared
|
||||
# or if they are the owner. To work around this problem we fetch the webooks
|
||||
# or if they are the owner. To work around this problem we fetch the webhooks
|
||||
# before we setup the device so we can skip it instead of failing.
|
||||
# webhooks are normally a list, however if there is an error
|
||||
# rachio hands us back a dict
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue