Skip to content

Commit

Permalink
Add Camera device
Browse files Browse the repository at this point in the history
if 'UsedByCamera' is True use Camera domain
  • Loading branch information
DewGew authored Feb 13, 2024
1 parent 2d2c715 commit a6733c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/domoticz.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def getDomain(device):
devs = devs.replace(" ", "")
devs = devs.replace("/", "")
devs = devs.replace("+", "")
if device["UsedByCamera"] == True:
devs = 'Camera'

return devs

Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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': [
Expand Down

0 comments on commit a6733c2

Please sign in to comment.