diff options
Diffstat (limited to '')
-rw-r--r-- | ParrotZik.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ParrotZik.py b/ParrotZik.py index bf2eb25..75680cc 100644 --- a/ParrotZik.py +++ b/ParrotZik.py @@ -35,7 +35,10 @@ class ParrotZik(object): def getBatteryLevel(self): data = self.sendGetMessage("/api/system/battery/get") - return data.answer.system.battery["level"] + try: + return data.answer.system.battery["level"] + except: + return "0" def getVersion(self): data = self.sendGetMessage("/api/software/version/get") @@ -49,6 +52,10 @@ class ParrotZik(object): data = self.sendGetMessage("/api/system/auto_connection/enabled/get") return data.answer.system.auto_connection["enabled"] + def setAutoConnection(self,arg): + data = self.sendSetMessage("/api/system/auto_connection/enabled/set",arg) + return data + def getAncPhoneMode(self): data = self.sendGetMessage("/api/system/anc_phone_mode/enabled/get") return data.answer.system.anc_phone_mode["enabled"] |