mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 03:16:37 +00:00
[sun] Use register_apply_condition for is_above_horizon and is_below_horizon (#19704)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user