diff options
author | Dmitry Moiseev <m0sia@m0sia.ru> | 2013-11-18 18:15:43 +0600 |
---|---|---|
committer | Dmitry Moiseev <m0sia@m0sia.ru> | 2013-11-18 18:15:43 +0600 |
commit | c932addf717a1f241dbc2a4ad8f78e9b5166e7ce (patch) | |
tree | 858c8dba0176e8f638fe1ebd955cce6af1393311 | |
parent | e5b0f4ad9a6b2b373ba543fe5b6763d10854919b (diff) | |
download | pyParrotZikTCP-c932addf717a1f241dbc2a4ad8f78e9b5166e7ce.tar.xz pyParrotZikTCP-c932addf717a1f241dbc2a4ad8f78e9b5166e7ce.zip |
Added charging state
Diffstat (limited to '')
-rw-r--r-- | ParrotZik.py | 5 |
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 |