summaryrefslogtreecommitdiff
path: root/include/py
diff options
context:
space:
mode:
Diffstat (limited to 'include/py')
-rw-r--r--include/py/homekit/camera/config.py3
-rw-r--r--include/py/homekit/util.py2
2 files changed, 5 insertions, 0 deletions
diff --git a/include/py/homekit/camera/config.py b/include/py/homekit/camera/config.py
index bcd5d07..257e5f1 100644
--- a/include/py/homekit/camera/config.py
+++ b/include/py/homekit/camera/config.py
@@ -138,6 +138,9 @@ class IpcamConfig(ConfigUnit):
def has_camera(self, camera: int) -> bool:
return camera in tuple(self['cameras'].keys())
+ def has_zone(self, zone: str) -> bool:
+ return zone in tuple(self['zones'].keys())
+
def get_camera_container(self, camera: int) -> VideoContainerType:
return self.get_camera_type(camera).get_container()
diff --git a/include/py/homekit/util.py b/include/py/homekit/util.py
index c686f29..4410251 100644
--- a/include/py/homekit/util.py
+++ b/include/py/homekit/util.py
@@ -121,6 +121,8 @@ def json_serial(obj):
return obj.value
if isinstance(obj, KeysView):
return list(obj)
+ if isinstance(obj, Addr):
+ return str(obj)
raise TypeError("Type %s not serializable" % type(obj))