aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Siarkowicz <mareksiarkowicz@gmail.com>2015-06-14 17:58:21 +0200
committerMarek Siarkowicz <mareksiarkowicz@gmail.com>2015-06-14 17:58:21 +0200
commit1bf1b662ee8ed729a67c9bf07d1b184691a86785 (patch)
tree59b10d51be9a920fb52eb309bbf5b583207772b2
parentf3425cc12cdc5837625ae490ab2302ecfafc0453 (diff)
downloadpyParrotZikTCP-1bf1b662ee8ed729a67c9bf07d1b184691a86785.tar.xz
pyParrotZikTCP-1bf1b662ee8ed729a67c9bf07d1b184691a86785.zip
Read battery on connection.
-rwxr-xr-xParrotZikTray4
1 files changed, 4 insertions, 0 deletions
diff --git a/ParrotZikTray b/ParrotZikTray
index 07b631a..44a02d1 100755
--- a/ParrotZikTray
+++ b/ParrotZikTray
@@ -125,6 +125,7 @@ class ParrotZikBaseInterface(object):
self.firmware_version.show()
self.auto_connection.show()
+ self.read_battery()
self.indicator.info_item.set_label("Connected to: "
+ self.parrot.friendly_name)
self.firmware_version.set_label(
@@ -154,6 +155,9 @@ class ParrotZikBaseInterface(object):
self.deactivate()
def refresh(self):
+ self.read_battery()
+
+ def read_battery(self):
if self.connected:
battery_level = self.parrot.battery_level
battery_state = self.parrot.battery_state