From 90d05fc494043573253e8658fade1350af608055 Mon Sep 17 00:00:00 2001 From: DewGew Date: Thu, 8 Feb 2024 10:22:37 +0100 Subject: [PATCH] Add timer trait --- modules/domoticz.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/domoticz.py b/modules/domoticz.py index 14cf1b5..c677ea5 100644 --- a/modules/domoticz.py +++ b/modules/domoticz.py @@ -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 @@ -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: