From bdc53d8151dff4bf1d27df9cf21e78acdcc0b651 Mon Sep 17 00:00:00 2001 From: Dmitry Moiseev Date: Fri, 8 Nov 2013 13:51:39 +0600 Subject: Sometimes zik returns empty string instead of battery level --- ParrotZik.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ParrotZik.py b/ParrotZik.py index 2746259..b7f5dd7 100644 --- a/ParrotZik.py +++ b/ParrotZik.py @@ -38,7 +38,8 @@ class ParrotZik(object): def getBatteryLevel(self): data = self.sendGetMessage("/api/system/battery/get") try: - self.BatteryLevel = data.answer.system.battery["level"] + if data.answer.system.battery["level"] <> '': + self.BatteryLevel = data.answer.system.battery["level"] except: pass -- cgit v1.2.1