Remove settings_entity (#887)

* Remove `settings_entity`

- Bump version to 3.5_dev
- Removed references to pictures removed from TFT
- Removed code related to closing settings pages
- Removed trigger `settings_entity`

* Removed `set_settings_entity` service

- Bump version to 3.5_dev
- Removed `set_settings_entity` service - BREAKING CHANGE
- Removed `settings_entity` text-sensor - BREAKING CHANGE
- Added service `open_entity_settings_page` - BREAKING CHANGE

* Removed `settings_entity`

- Bump version to 3.5_dev
- Removed old climate page (climate_backup)
- Removed pics related to old climate page (ids 16-47, 80-83, 95-96 and 125(US only))
- Enforces brightness on any page change (this allows wake-up on settings page with long press on physical buttons) - Pending removing code from Blueprint
- Added `entity` variable on pages `climate`, `lightsettings` and `coversettings`
- Added `entity` info to `nspanelevent` on pages `climate`, `lightsettings` and `coversettings`
- Added `back_page` variable on pages `climate`, `lightsettings` and `coversettings` (default: home)
- Moving to TFT close page logic on pages `climate`, `lightsettings` and `coversettings` - Pending changes on Blueprint and ESPHome
- Standardized name for `page_label` on pages `climate`, `lightsettings` and `coversettings`
- Standardized settings page names: `climate`, `cover` and `light` (Removed `settings` from page name)

* Removed `settings_entity`

* Removed `settings_entity`

* Removed `settings_entity`
This commit is contained in:
Edward Firmo
2023-06-22 14:16:47 +02:00
committed by GitHub
parent 10da9a65c6
commit c211d3f435
14 changed files with 2197 additions and 394 deletions

View File

@@ -133,6 +133,7 @@ button:
id: tft_update
entity_category: config
on_press:
- logger.log: "Button pressed: Update TFT display"
- binary_sensor.template.publish:
id: nextion_init
state: false
@@ -146,6 +147,7 @@ button:
id: tft_reparse_off
entity_category: config
on_press:
- logger.log: "Button pressed: Exit reparse"
- uart.write:
id: tf_uart
data: "DRAKJHSUYDGBNCJHGJKSHBDN"
@@ -162,6 +164,7 @@ api:
##### SERVICE TO UPDATE THE HMI FILE ##############
- service: upload_tft
then:
- logger.log: "Service: upload_tft"
- binary_sensor.template.publish:
id: nextion_init
state: false
@@ -172,6 +175,7 @@ api:
variables:
url: string
then:
- logger.log: "Service: upload_tft_url"
- binary_sensor.template.publish:
id: nextion_init
state: false
@@ -256,6 +260,7 @@ api:
label: string
text: string
then:
- logger.log: "Service: notification_show"
- wait_until:
binary_sensor.is_on: nextion_init
- lambda: |-
@@ -274,6 +279,7 @@ api:
##### Service to clear the notification #####
- service: notification_clear
then:
- logger.log: "Service: notification_clear"
- wait_until:
binary_sensor.is_on: nextion_init
- lambda: |-
@@ -281,15 +287,33 @@ api:
id(notification_text).publish_state("");
- switch.turn_off: notification_unread
##### Service to set entity-information for settings-page(s)
- service: set_settings_entity
##### Service to open information for settings-page(s)
- service: open_entity_settings_page
variables:
page: string
page_label: string
page_icon: string
page_icon_color: int
entity: string
back_page: string
then:
- wait_until:
binary_sensor.is_on: nextion_init
- lambda: |-
id(settings_entity).publish_state(entity.c_str());
std::string entity_component = page.c_str() + std::string(".entity");
id(disp1).set_component_text_printf(entity_component.c_str(), "%s", entity.c_str());
std::string cmd_page = std::string("page ") + page.c_str();
id(disp1).send_command_printf(cmd_page.c_str());
id(disp1).set_component_text_printf("page_label", "%s", page_label.c_str());
id(disp1).set_component_text_printf("back_page", "%s", back_page.c_str());
if ((page_icon.c_str() != std::string()) and (page_icon.c_str() != "") and (page != "climate"))
{
id(disp1).set_component_text_printf("icon_state", "%s", page_icon.c_str());
}
if (page_icon_color >= 0 and page != "climate")
{
id(disp1).set_component_font_color("icon_state", page_icon_color);
}
##### Service to play a rtttl tones #####
# Example tones : https://codebender.cc/sketch:109888#RTTTL%20Songs.ino
@@ -325,6 +349,12 @@ api:
- wait_until:
binary_sensor.is_on: nextion_init
- lambda: |-
id(disp1).send_command_printf("climateslider.maxval=%i", total_steps);
id(disp1).set_component_value("temp_offset", temp_offset);
id(disp1).set_component_value("temp_step", temp_step);
id(disp1).set_component_text_printf("current_temp", "%.1f°", current_temp);
id(disp1).show_component("current_temp");
id(disp1).show_component("current_icon");
if (target_temp > -999)
{
id(disp1).set_component_value("climateslider", slider_val);
@@ -344,13 +374,6 @@ api:
id(disp1).hide_component("decrease_temp");
id(disp1).hide_component("increase_temp");
}
- lambda: |-
id(disp1).send_command_printf("climateslider.maxval=%i", total_steps);
id(disp1).set_component_value("temp_offset", temp_offset);
id(disp1).set_component_value("temp_step", temp_step);
id(disp1).set_component_text_printf("current_temp", "%.1f°", current_temp);
id(disp1).show_component("current_temp");
id(disp1).show_component("current_icon");
#### Service to set the buttons ####
- service: set_button
@@ -690,10 +713,6 @@ text_sensor:
platform: template
id: notification_text
- name: ${device_name} Settings Entity
platform: template
id: settings_entity
##### NSPanel event sensor, the main action sensor - push to HA #####
- name: ${device_name} NSPanel event
platform: nextion
@@ -904,7 +923,7 @@ display:
- logger.log: "Nextion start - Jump to page 8"
- lambda: id(disp1).send_command_printf("page 8");
- logger.log: "Nextion start - Publish ESPHome version"
- lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "3.4"); ### esphome-version ###
- lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "3.5_dev"); ### esphome-version ###
- logger.log: "Nextion start - Wait for Home Assistant API"
- wait_until:
api.connected