Skip to content

Commit d06b506

Browse files
Add getHomeZoneStates
1 parent 485c09a commit d06b506

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/Restado.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,24 @@ public function getHomeZoneState($access_token, $zone_id) {
307307
$response = $client->send($request);
308308
return json_decode($response->getBody());
309309
}
310+
311+
/**
312+
* @param $access_token
313+
* @param $home_id
314+
* @return mixed
315+
*/
316+
public function getHomeZoneStates($access_token, $home_id) {
317+
$provider = $this->getProvider();
318+
319+
$request = $provider->getAuthenticatedRequest(
320+
'GET',
321+
'https://my.tado.com/api/v2/homes/' . $home_id . '/zoneStates',
322+
$access_token
323+
);
324+
$client = new \GuzzleHttp\Client();
325+
$response = $client->send($request);
326+
return json_decode($response->getBody());
327+
}
310328

311329
/**
312330
* @param $access_token
@@ -929,4 +947,4 @@ private function getProvider() {
929947
'urlResourceOwnerDetails' => null,
930948
]);
931949
}
932-
}
950+
}

0 commit comments

Comments
 (0)