From 0d9e15648a07e94a686ff1a541741e3e673dcf8e Mon Sep 17 00:00:00 2001 From: Darter Date: Sun, 21 Apr 2024 17:22:00 +0200 Subject: [PATCH 1/3] init --- components/datetime/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/datetime/index.rst b/components/datetime/index.rst index 26ff54eea0..c319c6a8db 100644 --- a/components/datetime/index.rst +++ b/components/datetime/index.rst @@ -231,7 +231,7 @@ See Also - :apiref:`DateTimeBase ` - :apiref:`DateEntity ` - :apiref:`DateCall ` -- :apiref:`TimeeEntity ` +- :apiref:`TimeEntity ` - :apiref:`TimeCall ` - :ghedit:`Edit` From f544f040f55d5d4f70a740cd37d23090d032652e Mon Sep 17 00:00:00 2001 From: Darter Date: Sun, 21 Apr 2024 18:48:47 +0200 Subject: [PATCH 2/3] change id names --- components/datetime/index.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/datetime/index.rst b/components/datetime/index.rst index c319c6a8db..77b0986f77 100644 --- a/components/datetime/index.rst +++ b/components/datetime/index.rst @@ -98,12 +98,12 @@ The ``date`` provided can be in one of 3 formats: # String date - datetime.date.set: - id: my_date + id: my_datetime_date date: "2023-12-04" # Individual date parts - datetime.date.set: - id: my_date + id: my_datetime_date date: year: 2023 month: 12 @@ -111,7 +111,7 @@ The ``date`` provided can be in one of 3 formats: # Using a lambda - datetime.date.set: - id: my_date + id: my_datetime_date date: !lambda |- // Return an ESPTime struct return {.day_of_month: 4, .month: 12, .year: 2023}; @@ -169,12 +169,12 @@ The ``time`` provided can be in one of 3 formats: # String time - datetime.time.set: - id: my_time + id: my_datetime_time time: "12:34:56" # Individual time parts - datetime.time.set: - id: my_time + id: my_datetime_time time: hour: 12 minute: 34 From 1eaf5e0d97fcebeb6fdd07f83a2b534c4d7b9ad1 Mon Sep 17 00:00:00 2001 From: Darter Date: Sun, 21 Apr 2024 18:55:08 +0200 Subject: [PATCH 3/3] all ids --- components/datetime/index.rst | 8 ++++---- components/datetime/template.rst | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/datetime/index.rst b/components/datetime/index.rst index 77b0986f77..e1550a1126 100644 --- a/components/datetime/index.rst +++ b/components/datetime/index.rst @@ -137,7 +137,7 @@ advanced stuff (see the full API Reference for more info). .. code-block:: cpp // Within lambda, set the date to 2024-02-25 - auto call = id(my_date).make_call(); + auto call = id(my_datetime_date).make_call(); call.set_date("2024-02-25"); call.perform(); @@ -182,7 +182,7 @@ The ``time`` provided can be in one of 3 formats: # Using a lambda - datetime.time.set: - id: my_time + id: my_datetime_time time: !lambda |- // Return an ESPTime struct return {.second: 56, .minute: 34, .hour: 12}; @@ -207,7 +207,7 @@ advanced stuff (see the full API Reference for more info). .. code-block:: cpp // Within lambda, set the time to 12:34:56 - auto call = id(my_time).make_call(); + auto call = id(my_datetime_time).make_call(); call.set_date("12:34:56"); call.perform(); @@ -222,7 +222,7 @@ advanced stuff (see the full API Reference for more info). .. code-block:: cpp // For example, create a custom log message when a value is received: - ESP_LOGI("main", "Value of my datetime: %0d:%02d:%02d", id(my_time).hour, id(my_time).minute, id(my_time).second); + ESP_LOGI("main", "Value of my datetime: %0d:%02d:%02d", id(my_datetime_time).hour, id(my_datetime_time).minute, id(my_datetime_time).second); See Also diff --git a/components/datetime/template.rst b/components/datetime/template.rst index 3619db27e0..c1b85b5029 100644 --- a/components/datetime/template.rst +++ b/components/datetime/template.rst @@ -13,7 +13,7 @@ using :ref:`lambdas `. datetime: # Example Date - platform: template - id: my_date + id: my_datetime_date type: date name: Pick a Date optimistic: yes @@ -22,7 +22,7 @@ using :ref:`lambdas `. # Example Time - platform: template - id: my_time + id: my_datetime_time type: time name: Pick a Time optimistic: yes