@@ -39,7 +39,7 @@ def __init__(self, rachio, config_entry):
39
39
40
40
def setup (self , hass ):
41
41
"""Rachio device setup."""
42
- response = self .rachio .person .getInfo ()
42
+ response = self .rachio .person .info ()
43
43
assert int (response [0 ][KEY_STATUS ]) == HTTP_OK , "API key error"
44
44
self ._id = response [1 ][KEY_ID ]
45
45
@@ -49,7 +49,9 @@ def setup(self, hass):
49
49
self .username = data [1 ][KEY_USERNAME ]
50
50
devices = data [1 ][KEY_DEVICES ]
51
51
for controller in devices :
52
- webhooks = self .rachio .notification .getDeviceWebhook (controller [KEY_ID ])[1 ]
52
+ webhooks = self .rachio .notification .get_device_webhook (controller [KEY_ID ])[
53
+ 1
54
+ ]
53
55
# The API does not provide a way to tell if a controller is shared
54
56
# or if they are the owner. To work around this problem we fetch the webooks
55
57
# before we setup the device so we can skip it instead of failing.
@@ -113,29 +115,29 @@ def _deinit_webhooks(_) -> None:
113
115
if not self ._webhooks :
114
116
# We fetched webhooks when we created the device, however if we call _init_webhooks
115
117
# again we need to fetch again
116
- self ._webhooks = self .rachio .notification .getDeviceWebhook (
118
+ self ._webhooks = self .rachio .notification .get_device_webhook (
117
119
self .controller_id
118
120
)[1 ]
119
121
for webhook in self ._webhooks :
120
122
if (
121
123
webhook [KEY_EXTERNAL_ID ].startswith (WEBHOOK_CONST_ID )
122
124
or webhook [KEY_ID ] == current_webhook_id
123
125
):
124
- self .rachio .notification .deleteWebhook (webhook [KEY_ID ])
126
+ self .rachio .notification .delete (webhook [KEY_ID ])
125
127
self ._webhooks = None
126
128
127
129
_deinit_webhooks (None )
128
130
129
131
# Choose which events to listen for and get their IDs
130
132
event_types = []
131
- for event_type in self .rachio .notification .getWebhookEventType ()[1 ]:
133
+ for event_type in self .rachio .notification .get_webhook_event_type ()[1 ]:
132
134
if event_type [KEY_NAME ] in LISTEN_EVENT_TYPES :
133
135
event_types .append ({"id" : event_type [KEY_ID ]})
134
136
135
137
# Register to listen to these events from the device
136
138
url = self .rachio .webhook_url
137
139
auth = WEBHOOK_CONST_ID + self .rachio .webhook_auth
138
- new_webhook = self .rachio .notification .postWebhook (
140
+ new_webhook = self .rachio .notification .add (
139
141
self .controller_id , auth , url , event_types
140
142
)
141
143
# Save ID for deletion at shutdown
@@ -154,7 +156,7 @@ def controller_id(self) -> str:
154
156
@property
155
157
def current_schedule (self ) -> str :
156
158
"""Return the schedule that the device is running right now."""
157
- return self .rachio .device .getCurrentSchedule (self .controller_id )[1 ]
159
+ return self .rachio .device .current_schedule (self .controller_id )[1 ]
158
160
159
161
@property
160
162
def init_data (self ) -> dict :
@@ -188,5 +190,5 @@ def list_flex_schedules(self) -> list:
188
190
189
191
def stop_watering (self ) -> None :
190
192
"""Stop watering all zones connected to this controller."""
191
- self .rachio .device .stopWater (self .controller_id )
193
+ self .rachio .device .stop_water (self .controller_id )
192
194
_LOGGER .info ("Stopped watering of all zones on %s" , str (self ))
0 commit comments