diff options
author | Dmitry Moiseev <m0sia@m0sia.ru> | 2013-11-18 18:56:05 +0600 |
---|---|---|
committer | Dmitry Moiseev <m0sia@m0sia.ru> | 2013-11-18 18:56:05 +0600 |
commit | 2d940ea220d18131a74c11b62fa58b0d615c6532 (patch) | |
tree | 468b1e5f00b03370458fa9c3f32072f673debf95 /ParrotZikTray | |
parent | 9e2616cae218272fd92dc7ad39a77c2d0bff5e79 (diff) | |
download | pyParrotZikTCP-2d940ea220d18131a74c11b62fa58b0d615c6532.tar.xz pyParrotZikTCP-2d940ea220d18131a74c11b62fa58b0d615c6532.zip |
Add charging status support
Diffstat (limited to '')
-rwxr-xr-x | ParrotZikTray | 21 |
1 files 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..") |