diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2024-02-18 01:35:57 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2024-02-18 01:35:57 +0300 |
commit | 42155370475b1f6619498ec2c43c1c7f328ce1a1 (patch) | |
tree | aa7a708bb94362e0c79d7f3678d07883baa4ba76 /include/py/homekit/camera/config.py | |
parent | 70b4a4f044cac8052bb0af7c585572e54489ea2f (diff) |
lws: wip
Diffstat (limited to 'include/py/homekit/camera/config.py')
-rw-r--r-- | include/py/homekit/camera/config.py | 7 |
1 files changed, 5 insertions, 2 deletions
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)) |