From 42155370475b1f6619498ec2c43c1c7f328ce1a1 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sun, 18 Feb 2024 01:35:57 +0300 Subject: lws: wip --- include/py/homekit/camera/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/py/homekit/camera') diff --git a/include/py/homekit/camera/config.py b/include/py/homekit/camera/config.py index 9685cab..bcd5d07 100644 --- a/include/py/homekit/camera/config.py +++ b/include/py/homekit/camera/config.py @@ -44,7 +44,7 @@ class IpcamConfig(ConfigUnit): } } }, - 'areas': { + 'zones': { 'type': 'dict', 'keysrules': {'type': 'string'}, 'valuesrules': { @@ -114,11 +114,14 @@ class IpcamConfig(ConfigUnit): # FIXME def get_all_cam_names(self, filter_by_server: Optional[str] = None, - filter_by_disk: Optional[int] = None) -> list[int]: + filter_by_disk: Optional[int] = None, + only_enabled=True) -> list[int]: cams = [] if filter_by_server is not None and filter_by_server not in _lbc: raise ValueError(f'invalid filter_by_server: {filter_by_server} not found in {_lbc.__class__.__name__}') for cam, params in self['cameras'].items(): + if only_enabled and not self.is_camera_enabled(cam): + continue if filter_by_server is None or params['server'] == filter_by_server: if filter_by_disk is None or params['disk'] == filter_by_disk: cams.append(int(cam)) -- cgit v1.2.3