Skip to content

Commit

Permalink
Merge pull request #104 from DewGew/CameraDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
DewGew authored Feb 28, 2024
2 parents 0ad827c + a55b19a commit 924feaa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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
4 changes: 2 additions & 2 deletions templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ <h5 id="title_other">Other devices <small>(not supported devices)</small><i clas
{% if (v['customData']['domain'] not in (
'Group','Scene','Thermostat', 'Setpoint','Temp', 'TempHumidity', 'TempHumidityBaro','SmokeDetector', 'Security',
'VenetianBlindsEU', 'OnOff', 'Dimmer', 'VenetianBlindsUS', 'Doorbell', 'DoorLock', 'DoorLockInverted', 'Selector', 'DoorContact', 'BlindsPercentage',
'MotionSensor', 'PushOnButton', 'PushOffButton', 'ColorSwitch', 'Contact') and 'Hidden' not in v['customData']['domain'] ) %}
'MotionSensor', 'PushOnButton', 'PushOffButton', 'ColorSwitch', 'Contact', 'Camera') and 'Hidden' not in v['customData']['domain'] ) %}
<div class="icon">
<i class="material-symbols-outlined" id="icon_{{ v['customData']['idx'] }}">unknown_2</i>
<small id="data_{{ v['customData']['idx'] }}">Not available</small>
Expand Down Expand Up @@ -906,7 +906,7 @@ <h5 id="title_other">Other devices <small>(not supported devices)</small><i clas
$("#title_security > i").toggleClass('bi bi-chevron-compact-up')
{% elif (v['customData']['domain'] not in (
'SmokeDetector', 'Security', 'VenetianBlindsEU', 'OnOff', 'VenetianBlindsUS', 'Doorbell', 'DoorLock', 'DoorLockInverted', 'DoorContact', 'BlindsStop', 'BlindsPercentage',
'MotionSensor', 'PushOnButton', 'PushOffButton', 'Contact') and 'Hidden' not in v['customData']['domain']) %}
'MotionSensor', 'PushOnButton', 'PushOffButton', 'Contact', 'Camera') and 'Hidden' not in v['customData']['domain']) %}
updateOthers_block.push("{{ v['customData']['idx'] }}")
$('#title_other').show()
{% else %}
Expand Down

0 comments on commit 924feaa

Please sign in to comment.