1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-01 10:52:19 +01:00

Add datetime date entities (#6191)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
RFDarter
2024-03-10 19:52:22 +01:00
committed by GitHub
parent 4ec2b37cc6
commit 1e96a19d09
44 changed files with 1553 additions and 22 deletions

View File

@@ -19,7 +19,20 @@ esphome:
# Templated
- sensor.template.publish:
id: template_sens
state: !lambda 'return 42.0;'
state: !lambda "return 42.0;"
- datetime.date.set:
id: test_date
date:
year: 2021
month: 1
day: 1
- datetime.date.set:
id: test_date
date: !lambda "return {.day_of_month = 1, .month = 1, .year = 2021};"
- datetime.date.set:
id: test_date
date: "2021-01-01"
binary_sensor:
- platform: template
@@ -125,3 +138,18 @@ alarm_control_panel:
name: Alarm Panel
codes:
- "1234"
datetime:
- platform: template
name: Date
id: test_date
type: date
set_action:
- logger.log: "set_value"
on_value:
- logger.log:
format: "Date: %04d-%02d-%02d"
args:
- x.year
- x.month
- x.day_of_month