aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ParrotZik.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ParrotZik.py b/ParrotZik.py
index 90aabd3..0c654a5 100644
--- a/ParrotZik.py
+++ b/ParrotZik.py
@@ -30,6 +30,7 @@ class ParrotZik(object):
data = self.sock.recv(3)
self.BatteryLevel = 100
+ self.BatteryCharging = False
print "Connected"
def getBatteryState(self):
@@ -41,6 +42,10 @@ class ParrotZik(object):
try:
if data.answer.system.battery["level"] <> '':
self.BatteryLevel = data.answer.system.battery["level"]
+ if data.answer.system.battery["state"] == 'charging':
+ self.BatteryCharging = True
+ else:
+ self.BatteryCharging = False
except:
pass