aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Siarkowicz <mareksiarkowicz@gmail.com>2015-06-14 13:17:24 +0200
committerMarek Siarkowicz <mareksiarkowicz@gmail.com>2015-06-14 13:17:34 +0200
commitf6a0309a3d00b7f80f41bfdf5a7d48fa8ae6f71a (patch)
treef90da4bf4364172e03599ffffde05d8db4e69cd8
parentda45da83c9d487e7b8ff8dca059b43f7769975b6 (diff)
downloadpyParrotZikTCP-f6a0309a3d00b7f80f41bfdf5a7d48fa8ae6f71a.tar.xz
pyParrotZikTCP-f6a0309a3d00b7f80f41bfdf5a7d48fa8ae6f71a.zip
Twicks to ParrotZik.
-rw-r--r--ParrotZik.py32
1 files changed, 13 insertions, 19 deletions
diff --git a/ParrotZik.py b/ParrotZik.py
index efa8732..b327338 100644
--- a/ParrotZik.py
+++ b/ParrotZik.py
@@ -165,28 +165,12 @@ class ParrotZikBase(object):
@property
def noise_cancel(self):
data = self.api.get("/api/audio/noise_cancellation/enabled")
- try:
- return self._result_to_bool(
- data.answer.audio.noise_cancellation["enabled"])
- except AttributeError:
- return False
+ return self._result_to_bool(
+ data.answer.audio.noise_cancellation["enabled"])
@noise_cancel.setter
def noise_cancel(self, arg):
- self.api.get("/api/audio/noise_cancellation/enabled", arg)
-
- @property
- def concert_hall(self):
- data = self.api.get("/api/audio/sound_effect/enabled")
- try:
- return self._result_to_bool(
- data.answer.audio.sound_effect["enabled"])
- except AttributeError:
- return False
-
- @concert_hall.setter
- def concert_hall(self, arg):
- self.api.get("/api/audio/sound_effect/enabled", arg)
+ self.api.set("/api/audio/noise_cancellation/enabled", arg)
def _result_to_bool(self, result):
if result == "true":
@@ -212,6 +196,16 @@ class ParrotZikVersion1(ParrotZikBase):
def lou_reed_mode(self, arg):
self.api.get("/api/audio/specific_mode/enabled", arg)
+ @property
+ def concert_hall(self):
+ data = self.api.get("/api/audio/sound_effect/enabled")
+ return self._result_to_bool(
+ data.answer.audio.sound_effect["enabled"])
+
+ @concert_hall.setter
+ def concert_hall(self, arg):
+ self.api.get("/api/audio/sound_effect/enabled", arg)
+
class ParrotZikVersion2(ParrotZikBase):
@property