Decode DP127 as 48 bytes (4 alarms), plus DP128, DP107 and DP126, from Tuya's data model. Add day switches, alarm and sunset controls, a knock sensor on PA18, display schedule, bedtime fade, radio timer and grouped web UI. Pin LibreTiny v1.14.0 for the OTA restart fix. Ship the patched UART as an external component so a server needs only a short YAML. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
1.0 KiB
YAML
28 lines
1.0 KiB
YAML
###############################################################################
|
|
# One weekday switch for one alarm. Included per day from alarm_block.yaml.
|
|
# n, o come from alarm_block.yaml; day = label, bit = bit in the weekday mask,
|
|
# w = sort position in the web UI.
|
|
###############################################################################
|
|
|
|
switch:
|
|
- platform: template
|
|
id: alarm_${n}_day_${bit}
|
|
name: "Alarm ${n} ${day}"
|
|
icon: "mdi:calendar"
|
|
web_server:
|
|
sorting_group_id: group_alarm_${n}
|
|
sorting_weight: ${w}
|
|
lambda: |-
|
|
if (!id(alarm_raw_valid)) return {};
|
|
return (id(alarm_raw)[${o} + 3] >> ${bit}) & 1;
|
|
turn_on_action:
|
|
- lambda: |-
|
|
if (!id(alarm_raw_valid)) return;
|
|
id(alarm_raw)[${o} + 3] |= (1 << ${bit});
|
|
- script.execute: send_alarm_settings
|
|
turn_off_action:
|
|
- lambda: |-
|
|
if (!id(alarm_raw_valid)) return;
|
|
id(alarm_raw)[${o} + 3] &= ~(1 << ${bit});
|
|
- script.execute: send_alarm_settings
|