From 83c29b6c74f3ee95f930eb0468a4740508b0c434 Mon Sep 17 00:00:00 2001 From: RFDarter Date: Wed, 29 May 2024 20:58:30 +0200 Subject: [PATCH 01/27] Webserver-mention-v3 (#3881) Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- components/web_server.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/web_server.rst b/components/web_server.rst index c68ed06d1..2e8211380 100644 --- a/components/web_server.rst +++ b/components/web_server.rst @@ -64,7 +64,7 @@ Configuration variables: - **ota** (*Optional*, boolean): Turn on or off the OTA feature inside webserver. Strongly not suggested without enabled authentication settings. Defaults to ``true``. Cannot be used with the ``esp-idf`` framework. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - **local** (*Optional*, boolean): Include supporting javascript locally allowing it to work without internet access. Defaults to ``false``. -- **version** (*Optional*, string): ``1`` or ``2``. Version 1 displays as a table. Version 2 uses web components and has more functionality. Defaults to ``2``. +- **version** (*Optional*, string): ``1``, ``2`` or ``3``. Version 1 displays as a table. Version 2 uses web components and has more functionality. Version 3 uses HA-Styling. Defaults to ``2``. To conserve flash size, the CSS and JS files used on the root page to show a simple user interface are hosted by esphome.io. If you want to use your own service, use the From 0138eca827afac89d7ea1479728bd5b240fef321 Mon Sep 17 00:00:00 2001 From: RFDarter Date: Thu, 30 May 2024 00:07:25 +0200 Subject: [PATCH 02/27] Change datetime id names in examples (#3777) --- components/datetime/index.rst | 18 +++++++++--------- components/datetime/template.rst | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/components/datetime/index.rst b/components/datetime/index.rst index ed68bb424..79ccb28a2 100644 --- a/components/datetime/index.rst +++ b/components/datetime/index.rst @@ -103,12 +103,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 @@ -116,7 +116,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}; @@ -142,7 +142,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(); @@ -174,12 +174,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 @@ -187,7 +187,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}; @@ -212,7 +212,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_time("12:34:56"); call.perform(); @@ -227,7 +227,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); DateTime Automation diff --git a/components/datetime/template.rst b/components/datetime/template.rst index e99161908..c6110918c 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 From 13fbdb1d005433c7ba6cb557b272c482985a11cc Mon Sep 17 00:00:00 2001 From: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com> Date: Thu, 30 May 2024 08:08:17 +1000 Subject: [PATCH 03/27] Make search results appear in a fixed window; (#3858) --- _static/custom.css | 25 +++++- _templates/layout.html | 4 +- _templates/searchbox.html | 168 +++++++++++++++++++++++++++++++------- 3 files changed, 162 insertions(+), 35 deletions(-) diff --git a/_static/custom.css b/_static/custom.css index e7bd6737d..28dcfda72 100644 --- a/_static/custom.css +++ b/_static/custom.css @@ -1,3 +1,9 @@ +/* provide this to be queried in JS. Sadly can't be used in media-queries just yet*/ + +:root { + --mobile-width-stop: 875; +} + .row-odd { background-color: #f3f6f6; } @@ -263,9 +269,8 @@ div.body p, div.body dd, div.body li, div.body blockquote { .search-results { background-color: #f8f8f8; box-shadow: 0 6px 10px rgb(0 0 0 / 0.2); - position: absolute; + position: fixed; z-index: 1500; - margin-top: 4px; padding-right: 6px; padding-left: 6px; border-radius: 12px; @@ -277,6 +282,21 @@ div.body p, div.body dd, div.body li, div.body blockquote { display: none; } +@media screen and (max-width: 875px) { + /* hide search result thumbnails on mobile */ + .pagefind-modular-list-thumb { + width: 0; + } + /* reduce height of search box */ + .pagefind-modular-input-wrapper { + scale: 90%; + } + .logo { + scale: 60%; + } +} + + /* dark theme */ @media (prefers-color-scheme: dark) { @@ -383,6 +403,7 @@ div.body p, div.body dd, div.body li, div.body blockquote { .pagefind-ui__form, .pagefind-modular-input, .search-results { color: #ececec !important; } + :root { --pagefind-ui-primary: #eeeeee; --pagefind-ui-text: #eeeeee; diff --git a/_templates/layout.html b/_templates/layout.html index fe0c58b89..8aa6b7342 100644 --- a/_templates/layout.html +++ b/_templates/layout.html @@ -26,7 +26,8 @@ - + {% endblock %} {% block relbar_top %} @@ -39,7 +40,6 @@ {% endif %} -
{% endblock %} {% block footer %} diff --git a/_templates/searchbox.html b/_templates/searchbox.html index 7a7de9aaa..95495c124 100644 --- a/_templates/searchbox.html +++ b/_templates/searchbox.html @@ -1,42 +1,150 @@ -