From a6733c26ea088a3ce777055f66db85e2c2f205c6 Mon Sep 17 00:00:00 2001 From: DewGew Date: Tue, 13 Feb 2024 08:01:34 +0100 Subject: [PATCH] Add Camera device if 'UsedByCamera' is True use Camera domain --- modules/domoticz.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/domoticz.py b/modules/domoticz.py index 47a1c14..b14998c 100644 --- a/modules/domoticz.py +++ b/modules/domoticz.py @@ -37,6 +37,8 @@ def getDomain(device): devs = devs.replace(" ", "") devs = devs.replace("/", "") devs = devs.replace("+", "") + if device["UsedByCamera"] == True: + devs = 'Camera' return devs @@ -181,7 +183,7 @@ def getAog(device, user_id=None): hide = desc.get('hide', False) if hide: domain = domain + '_Hidden' - + aog.customData['idx'] = device.get('idx') aog.customData['domain'] = domain aog.customData['protected'] = device.get('Protected') @@ -344,6 +346,8 @@ def getAog(device, user_id=None): if domain == 'Doorbell': aog.type = 'action.devices.types.DOORBELL' aog.traits.append('action.devices.traits.ObjectDetection') + if device.get('CameraIdx'): + aog.customData['cameraIdx'] = device.get('CameraIdx') aog.traits.append('action.devices.traits.CameraStream') aog.attributes = { 'cameraStreamSupportedProtocols': [