Commit cbf40fdc authored by Cédrick COPOL's avatar Cédrick COPOL

API-debug: corrige la lecture du niveau de battery

parent e1bf1a5c
......@@ -167,17 +167,10 @@ class Device(object):
mettre les valeurs pouvant varier"""
for device in devices:
if device["deviceid"] == self.ID:
self.battery = device["battery"]
self.battery = int(device["battery"])
self.timezone = device["timezone"]
break
def battery_level(self):
if self.battery >= 75:
return "high"
elif self.battery >=30:
return "medium"
else:
return "low"
class API(object):
base_api = "https://wbsapi.withings.net"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment