idk
This commit is contained in:
@@ -68,57 +68,6 @@ let
|
||||
mode: single
|
||||
'';
|
||||
|
||||
automationToYamlSwitch = mlcfg: ''
|
||||
- id: '${toString mlcfg.id}'
|
||||
alias: ${mlcfg.alias}
|
||||
description: '${mlcfg.description}'
|
||||
triggers:
|
||||
- device_id: ${mlcfg.motion-sensor.mqttDeviceId}
|
||||
entity_id: ${mlcfg.motion-sensor.mqttEntityId}
|
||||
domain: binary_sensor
|
||||
id: occupied
|
||||
subtype: on_press
|
||||
trigger: device
|
||||
type: occupied
|
||||
for:
|
||||
hours: 0
|
||||
minutes: 0
|
||||
seconds: 0
|
||||
- device_id: ${mlcfg.motion-sensor.mqttDeviceId}
|
||||
entity_id: ${mlcfg.motion-sensor.mqttEntityId}
|
||||
domain: binary_sensor
|
||||
id: vacant
|
||||
subtype: off_press
|
||||
trigger: device
|
||||
type: not_occupied
|
||||
for:
|
||||
hours: 0
|
||||
minutes: 0
|
||||
seconds: 5
|
||||
conditions: []
|
||||
actions:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- occupied
|
||||
sequence:
|
||||
- type: turn_on
|
||||
device_id: ${mlcfg.switch.deviceId}
|
||||
entity_id: ${mlcfg.switch.entityId}
|
||||
domain: switch
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id:
|
||||
- vacant
|
||||
sequence:
|
||||
- type: turn_off
|
||||
device_id: ${mlcfg.switch.deviceId}
|
||||
entity_id: ${mlcfg.switch.entityId}
|
||||
domain: switch
|
||||
mode: single
|
||||
'';
|
||||
|
||||
motionLightAutomations = concatStringsSep "\n" (
|
||||
mapAttrsToList (_: automationToYaml) cfg.motion-light
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user