Skip to content

Commit

Permalink
datetime removed rom uHoo API
Browse files Browse the repository at this point in the history
`offline` added
  • Loading branch information
csacca committed Sep 16, 2021
1 parent 7740ebf commit 0195b14
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions pyuhoo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def example(username, password):
print("[+] Data from first device:")
print(
f" Serial Number: {device.serial_number}\n"
+ f" Timestamp: {device.datetime}\n"
+ f" Timestamp: {device.timestamp}\n"
+ f" Temperature: {device.temp} {client.user_settings_temp}\n"
)

Expand All @@ -45,7 +45,7 @@ async def example(username, password):
print("[+] Data from first device:")
print(
f" Serial Number: {device.serial_number}\n"
+ f" Timestamp: {device.datetime}\n"
+ f" Timestamp: {device.timestamp}\n"
+ f" Temperature: {device.temp} {client.user_settings_temp}\n"
)

Expand Down
2 changes: 0 additions & 2 deletions pyuhoo/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def __init__(self, device: dict) -> None:

self.co: float # might be an int
self.co2: float # might be an int
self.datetime: str # "YYYY-MM-DD hh:mm:ss" local time
self.dust: float
self.humidity: float
self.no2: float
Expand Down Expand Up @@ -49,7 +48,6 @@ def update_device(self, device: dict) -> None:
def update_data(self, data: dict) -> None:
self.co = data["co"]["value"]
self.co2 = data["co2"]["value"]
self.datetime = data["datetime"]
self.dust = data["dust"]["value"]
self.humidity = data["humidity"]["value"]
self.no2 = data["no2"]["value"]
Expand Down
24 changes: 12 additions & 12 deletions tests/test_api_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,23 @@
"ozone",
"no2",
"virusScore",
"datetime",
]
DATA_LATEST_DEVICES_KEYS = [
"name",
"serialNumber",
"macAddress",
"status",
"latitude",
"home",
"ssid",
"longitude",
"createdAt",
"server",
"calibration",
"location",
"city",
"city_ios",
"createdAt",
"home",
"latitude",
"location",
"longitude",
"macAddress",
"name",
"offline",
"serialNumber",
"server",
"ssid",
"status",
"threshold",
]

Expand Down

0 comments on commit 0195b14

Please sign in to comment.