aboutsummaryrefslogtreecommitdiff
path: root/parrot_zik
diff options
context:
space:
mode:
authorEsteban Sánchez <esteban.sanchez@gmail.com>2015-07-03 13:33:26 +0200
committerMarek Siarkowicz <mareksiarkowicz@gmail.com>2015-07-03 13:49:07 +0200
commit22e903f15887bff972ecd0f28c0ee485e918c3f4 (patch)
treee0124919d2645beff7579a3389cea19e9e6c922e /parrot_zik
parent3d455057798db862b5e1fb510d2f4aceaf71515a (diff)
downloadpyParrotZikTCP-22e903f15887bff972ecd0f28c0ee485e918c3f4.tar.xz
pyParrotZikTCP-22e903f15887bff972ecd0f28c0ee485e918c3f4.zip
Fixed cast when the value is an empty string
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):