From 2d940ea220d18131a74c11b62fa58b0d615c6532 Mon Sep 17 00:00:00 2001 From: Dmitry Moiseev Date: Mon, 18 Nov 2013 18:56:05 +0600 Subject: Add charging status support --- ParrotZikTray | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/ParrotZikTray b/ParrotZikTray index 3c1dd49..4d6a6b0 100755 --- a/ParrotZikTray +++ b/ParrotZikTray @@ -164,19 +164,32 @@ class ParrotZikIndicator: if self.connected: print "Updating battery" self.batteryLevel = int(self.parrot.getBatteryLevel()) - self.info_item.set_label("Connected to: "+self.name+ - "\nFirmware version: "+self.version+ - "\nBattery Level: "+str(self.batteryLevel)+"%") - if self.batteryLevel>80: + + if self.parrot.BatteryCharging: + self.batteryLevel = "Charging" + self.setIcon("zik-battery-charging") + self.batteryLevel="Unknown" + self.batteryState="Charging" + elif self.batteryLevel>80: self.setIcon("zik-battery-100") + self.batteryState="In Use" elif self.batteryLevel>60: self.setIcon("zik-battery-080") + self.batteryState="In Use" elif self.batteryLevel>40: self.setIcon("zik-battery-060") + self.batteryState="In Use" elif self.batteryLevel>20: self.setIcon("zik-battery-040") + self.batteryState="In Use" else: self.setIcon("zik-battery-low") + self.batteryState="In Use" + + self.info_item.set_label("Connected to: "+self.name+ + "\nFirmware version: "+self.version+ + "\nState: "+self.batteryState+ + "\nBattery Level: "+str(self.batteryLevel)) else: self.setIcon("zik-audio-headset") self.info_item.set_label("Parrot Zik Not connected..") -- cgit v1.2.1