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
|
can_pause = True
|
||||||
break
|
break
|
||||||
|
|
||||||
if not can_pause:
|
|
||||||
return
|
|
||||||
|
|
||||||
all_devices = [rachio_iro.name for rachio_iro in self._controllers]
|
all_devices = [rachio_iro.name for rachio_iro in self._controllers]
|
||||||
|
|
||||||
def pause_water(service):
|
def pause_water(service):
|
||||||
|
@ -97,6 +94,16 @@ class RachioPerson:
|
||||||
if iro.name in devices:
|
if iro.name in devices:
|
||||||
iro.stop_watering()
|
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(
|
hass.services.async_register(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
SERVICE_PAUSE_WATERING,
|
SERVICE_PAUSE_WATERING,
|
||||||
|
@ -111,13 +118,6 @@ class RachioPerson:
|
||||||
schema=RESUME_SERVICE_SCHEMA,
|
schema=RESUME_SERVICE_SCHEMA,
|
||||||
)
|
)
|
||||||
|
|
||||||
hass.services.async_register(
|
|
||||||
DOMAIN,
|
|
||||||
SERVICE_STOP_WATERING,
|
|
||||||
stop_water,
|
|
||||||
schema=STOP_SERVICE_SCHEMA,
|
|
||||||
)
|
|
||||||
|
|
||||||
def _setup(self, hass):
|
def _setup(self, hass):
|
||||||
"""Rachio device setup."""
|
"""Rachio device setup."""
|
||||||
rachio = self.rachio
|
rachio = self.rachio
|
||||||
|
@ -134,7 +134,7 @@ class RachioPerson:
|
||||||
for controller in devices:
|
for controller in devices:
|
||||||
webhooks = rachio.notification.get_device_webhook(controller[KEY_ID])[1]
|
webhooks = rachio.notification.get_device_webhook(controller[KEY_ID])[1]
|
||||||
# The API does not provide a way to tell if a controller is shared
|
# 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.
|
# before we setup the device so we can skip it instead of failing.
|
||||||
# webhooks are normally a list, however if there is an error
|
# webhooks are normally a list, however if there is an error
|
||||||
# rachio hands us back a dict
|
# rachio hands us back a dict
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue