Skip to content

Commit

Permalink
Add timer trait
Browse files Browse the repository at this point in the history
  • Loading branch information
DewGew authored Feb 8, 2024
1 parent 73648f4 commit 90d05fc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/domoticz.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ def getAog(device, user_id=None):
aog.type = 'action.devices.types.SWITCH'
if domain in ['DoorLock', 'DoorLockInverted']:
aog.type = 'action.devices.types.LOCK'
if domain in ['OnOff', 'Dimmer', 'ColorSwitch']:
aog.traits.append('action.devices.traits.Timer')

aog.customData['check_state'] = True
# Try to get device specific voice control configuration from Domoticz
Expand Down Expand Up @@ -352,6 +350,11 @@ def getAog(device, user_id=None):
],
'cameraStreamNeedAuthToken': False
}

if domain in ['OnOff', 'Dimmer', 'ColorSwitch']:
aog.traits.append('action.devices.traits.Timer')
aog.attributes['maxTimerLimitSec'] = 7200
aog.attributes['commandOnlyTimer'] = True

batteryLevel = device.get('BatteryLevel')
if domain not in ['Group', 'Scene'] and batteryLevel != 255:
Expand Down

0 comments on commit 90d05fc

Please sign in to comment.