From c932addf717a1f241dbc2a4ad8f78e9b5166e7ce Mon Sep 17 00:00:00 2001 From: Dmitry Moiseev Date: Mon, 18 Nov 2013 18:15:43 +0600 Subject: Added charging state --- ParrotZik.py | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.1