diff options
author | Marek Siarkowicz <mareksiarkowicz@gmail.com> | 2015-06-12 22:30:49 +0200 |
---|---|---|
committer | Marek Siarkowicz <mareksiarkowicz@gmail.com> | 2015-06-12 22:30:49 +0200 |
commit | 4d780ca17fd26bf963f0a530fb5cf50e4435f2b0 (patch) | |
tree | 52ea3a6809c358ab91e3609397651aad7ef4d729 | |
parent | dfb630d52ccae6c8fdd70ab7210c32b327a4fed7 (diff) | |
download | pyParrotZikTCP-4d780ca17fd26bf963f0a530fb5cf50e4435f2b0.tar.xz pyParrotZikTCP-4d780ca17fd26bf963f0a530fb5cf50e4435f2b0.zip |
Refresh data less often.
Diffstat (limited to '')
-rw-r--r-- | ParrotZik.py | 1 | ||||
-rwxr-xr-x | ParrotZikTray | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/ParrotZik.py b/ParrotZik.py index 551d19a..d159927 100644 --- a/ParrotZik.py +++ b/ParrotZik.py @@ -52,7 +52,6 @@ class ParrotZik(object): self.BatteryLevel = 100 self.BatteryCharging = False - print "Connected" @property def battery_state(self): diff --git a/ParrotZikTray b/ParrotZikTray index f66de17..6a7ab69 100755 --- a/ParrotZikTray +++ b/ParrotZikTray @@ -7,7 +7,7 @@ from SysIndicator import MenuItem from SysIndicator import Menu from SysIndicator import SysIndicator -REFRESH_FREQUENCY = 1000 +REFRESH_FREQUENCY = 30000 RECONNECT_FREQUENCY = 5000 @@ -16,6 +16,9 @@ class repeat(object): self.f = f self.id = None + def __call__(self, cls): + self.f(cls) + def start(self, cls, frequency): if not self.id: def run(): @@ -65,6 +68,7 @@ class ParrotZikIndicator(SysIndicator): parrot = ParrotZik.ParrotZik(mac) if parrot.sock: self.version_1_interface.activate(parrot) + self.autorefresh(self) self.autorefresh.start(self, REFRESH_FREQUENCY) self.reconnect.stop() print "Connected" |