aboutsummaryrefslogtreecommitdiff
path: root/ParrotZik.py
diff options
context:
space:
mode:
authorMarek Siarkowicz <mareksiarkowicz@gmail.com>2015-06-13 00:37:49 +0200
committerMarek Siarkowicz <mareksiarkowicz@gmail.com>2015-06-13 00:37:49 +0200
commit7856465e1ab0ab69101996b12e93450c6bea160b (patch)
tree0a0478b3696be337fc080163f1cac085f1af3295 /ParrotZik.py
parentd53188baa1c4175d2f9456ac722d35facb47f818 (diff)
downloadpyParrotZikTCP-7856465e1ab0ab69101996b12e93450c6bea160b.tar.xz
pyParrotZikTCP-7856465e1ab0ab69101996b12e93450c6bea160b.zip
Add flight mode.
Diffstat (limited to 'ParrotZik.py')
-rw-r--r--ParrotZik.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ParrotZik.py b/ParrotZik.py
index c47ce26..7cb623d 100644
--- a/ParrotZik.py
+++ b/ParrotZik.py
@@ -195,3 +195,12 @@ class ParrotZikVersion2(ParrotZikBase):
@property
def battery_level(self):
return self.get_battery_level('percent')
+
+ @property
+ def flight_mode(self):
+ data = self.api.get('/api/flight_mode/get')
+ return self._result_to_bool(data.answer.flight_mode['enabled'])
+
+ @flight_mode.setter
+ def flight_mode(self, arg):
+ self.api.set('/api/flight_mode/enable', arg)