aboutsummaryrefslogtreecommitdiff
path: root/parrot_zik
diff options
context:
space:
mode:
Diffstat (limited to 'parrot_zik')
-rw-r--r--parrot_zik/model/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/parrot_zik/model/base.py b/parrot_zik/model/base.py
index 0cd4652..d722788 100644
--- a/parrot_zik/model/base.py
+++ b/parrot_zik/model/base.py
@@ -16,7 +16,7 @@ class ParrotZikBase(object):
def get_battery_level(self, field_name):
answer = self.resource_manager.get("/api/system/battery")
- return int(answer.system.battery[field_name])
+ return int(answer.system.battery[field_name] or 0)
@property
def friendly_name(self):