1
0
mirror of https://github.com/USA-RedDragon/badnest.git synced 2025-09-09 21:31:53 +01:00

Attempt to make the camera's use different API instances

This commit is contained in:
Jacob McSwain
2019-10-23 21:46:55 -05:00
parent 77bd36b4bd
commit 51efa759e8
2 changed files with 18 additions and 12 deletions

View File

@@ -356,18 +356,26 @@ class NestTemperatureSensorAPI(NestAPI):
class NestCameraAPI(NestAPI):
def __init__(self, email, password, issue_token, cookie, api_key):
def __init__(self,
email,
password,
issue_token,
cookie,
api_key,
device_id=None):
super(NestCameraAPI, self).__init__(
email,
password,
issue_token,
cookie,
api_key)
api_key,
device_id)
# log into dropcam
self._session.post(
f"{API_URL}/dropcam/api/login",
data={"access_token": self._access_token}
)
self._device_id = device_id
self.location = None
self.name = "Nest Camera"
self.online = None
@@ -377,10 +385,6 @@ class NestCameraAPI(NestAPI):
self.data_tier = None
self.update()
def set_device(self, uuid):
self._device_id = uuid
self.update()
def update(self):
if self._device_id:
props = self.get_properties()