mirror of
https://github.com/USA-RedDragon/badnest.git
synced 2025-01-18 23:00:43 +00:00
API: Update should be called in the regular class, not the dummy class
This commit is contained in:
parent
12d2866676
commit
9fb3e12061
@ -20,7 +20,6 @@ class NestAPI:
|
|||||||
self._login_google(issue_token, cookie, api_key)
|
self._login_google(issue_token, cookie, api_key)
|
||||||
else:
|
else:
|
||||||
self._login_nest(email, password)
|
self._login_nest(email, password)
|
||||||
self.update()
|
|
||||||
|
|
||||||
def _login_nest(self, email, password):
|
def _login_nest(self, email, password):
|
||||||
r = self._session.post(
|
r = self._session.post(
|
||||||
@ -56,9 +55,6 @@ class NestAPI:
|
|||||||
self._user_id = r.json()['claims']['subject']['nestId']['id']
|
self._user_id = r.json()['claims']['subject']['nestId']['id']
|
||||||
self._access_token = r.json()['jwt']
|
self._access_token = r.json()['jwt']
|
||||||
|
|
||||||
def update(self):
|
|
||||||
raise NotImplementedError()
|
|
||||||
|
|
||||||
|
|
||||||
class NestThermostatAPI(NestAPI):
|
class NestThermostatAPI(NestAPI):
|
||||||
def __init__(self, email, password, issue_token, cookie, api_key):
|
def __init__(self, email, password, issue_token, cookie, api_key):
|
||||||
@ -87,6 +83,7 @@ class NestThermostatAPI(NestAPI):
|
|||||||
self.target_temperature_high = None
|
self.target_temperature_high = None
|
||||||
self.target_temperature_low = None
|
self.target_temperature_low = None
|
||||||
self.current_humidity = None
|
self.current_humidity = None
|
||||||
|
self.update()
|
||||||
|
|
||||||
def get_action(self):
|
def get_action(self):
|
||||||
if self._hvac_ac_state:
|
if self._hvac_ac_state:
|
||||||
@ -240,6 +237,7 @@ class NestCameraAPI(NestAPI):
|
|||||||
self.battery_voltage = None
|
self.battery_voltage = None
|
||||||
self.ac_voltge = None
|
self.ac_voltge = None
|
||||||
self.data_tier = None
|
self.data_tier = None
|
||||||
|
self.update()
|
||||||
|
|
||||||
def set_device(self, uuid):
|
def set_device(self, uuid):
|
||||||
self._device_id = uuid
|
self._device_id = uuid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user