[sun] Use register_apply_condition for is_above_horizon and is_below_horizon (#19704)

This commit is contained in:
J. Nick Koston
2026-09-25 20:33:50 -04:00
committed by GitHub
parent 1a158e5ba0
commit 2fc48a3d9e
4 changed files with 39 additions and 67 deletions
+21
View File
@@ -0,0 +1,21 @@
button:
- platform: template
name: Sun position
on_press:
- if:
condition:
sun.is_above_horizon:
then:
- logger.log: Day
- if:
condition:
sun.is_below_horizon:
elevation: -6°
then:
- logger.log: Night
- if:
condition:
sun.is_above_horizon:
elevation: !lambda return 10.0;
then:
- logger.log: High sun
@@ -0,0 +1,3 @@
packages:
sun: !include common.yaml
actions: !include common-actions.yaml