diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 664bf97..e3466cd 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -17,7 +17,7 @@ substitutions: invalid_cooldown: "100ms" bytes_per_char: "1" ##### DON'T CHANGE THIS ###### - version: "4.3.3" + version: "4.3.4" ############################## ##### External components ##### @@ -27,7 +27,7 @@ external_components: # path: packages/Blackymas/components type: git url: https://github.com/Blackymas/NSPanel_HA_Blueprint - ref: v4.3.3 + ref: v4.3.4 components: - nspanel_ha_blueprint refresh: 300s @@ -799,6 +799,30 @@ api: then: - lambda: if (!id(is_uploading_tft)) buzzer->play(tone); + - service: set_bool + variables: + component: string + val: bool + then: + - lambda: |- + if (component == "is_climate") id(is_climate) = val; + + - service: set_string + variables: + component: string + val: string + then: + - lambda: |- + if (component == "timezone") set_timezone->execute(val.c_str()); + + - service: set_timezone # To do: Merge this on another init service for v4.4.0 + variables: + timezone: string + then: + - script.execute: + id: set_timezone + timezone: !lambda return timezone; + # Utilities group refresh - service: utilities_group_refresh variables: @@ -874,14 +898,6 @@ api: } } - - service: set_timezone # To do: Merge this on another init service for v4.4.0 - variables: - timezone: string - then: - - script.execute: - id: set_timezone - timezone: !lambda return timezone; - # Wake Up Service - service: wake_up variables: @@ -938,9 +954,9 @@ display: switch (component_id) { case 4: // indr_temp case 27: // indr_temp_icon - if (id(is_embedded_thermostat) and !touch_event) { // Release - detailed_entity->publish_state("embedded_climate"); - disp1->set_component_value("climate.embedded", 1); + if (id(is_climate) and !touch_event) { // Release + detailed_entity->publish_state((id(is_embedded_thermostat)) ? "embedded_climate" : ""); + disp1->set_component_value("climate.embedded", id(is_embedded_thermostat) ? 1 : 0); goto_page->execute("climate"); } break; @@ -998,6 +1014,11 @@ display: ##### START - GLOBALS CONFIGURATION ##### globals: + - id: is_climate + type: bool + restore_value: true + initial_value: 'true' + - id: mui_timezone type: std::string restore_value: true diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 753bcb4..bef9b00 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -10,7 +10,7 @@ blueprint: description: > # NSPanel Configuration via Blueprint: Complete UI-Based Setup - **Version**: v4.3.3 + **Version**: v4.3.4 This project enables comprehensive configuration of your NSPanel through a Blueprint featuring a user interface. @@ -3833,6 +3833,7 @@ trigger_variables: group06: !input utilities_page01_group06_line_reference variables: + blueprint_version: '4.3.4' pages: current: '{{ states(currentpage) }}' home: "home" @@ -4704,7 +4705,6 @@ condition: action: - variables: ##### GENERAL ##### - blueprint_version: '4.3.3' nspanel_name: > {{ trigger.event.data.device_name @@ -8237,9 +8237,10 @@ action: else timezone }} - *delay_default - - service: 'esphome.{{ nspanel_name }}_set_timezone' + - service: 'esphome.{{ nspanel_name }}_set_string' data: - timezone: '{{ timezone_code }}' + component: "timezone" + val: '{{ timezone_code }}' continue_on_error: true ##### Home page ##### @@ -8414,9 +8415,19 @@ action: continue_on_error: true - variables: - climate_friendly_name: '{{ state_attr(climate, "friendly_name") if climate is string and climate is match "climate." else "" }}' + climate_entity_id_valid: '{{ climate is string and climate is match "climate." }}' + climate_friendly_name: '{{ state_attr(climate, "friendly_name") if climate_entity_id_valid else "" }}' hw_buttons_bars_pages: !input hw_buttons_bars_pages + - if: '{{ not climate_entity_id_valid }}' + then: + - *delay_default + - service: 'esphome.{{ nspanel_name }}_set_bool' + data: + component: "is_climate" + val: '{{ climate_entity_id_valid }}' + continue_on_error: true + - *delay_default - service: 'esphome.{{ nspanel_name }}_init_hardware' data: @@ -8434,7 +8445,7 @@ action: button_bar_color_on: !input hw_buttons_bar_color_on button_bar_color_off: !input hw_buttons_bar_color_off embedded_climate: '{{ climate == thermostat_embedded }}' - embedded_climate_friendly_name: '{{ climate_friendly_name if climate_friendly_name else "" }}' + embedded_climate_friendly_name: '{{ climate_friendly_name if climate_friendly_name else "" }}' # To do: v4.4 - This will send name even when no embedded climate embedded_indoor_temperature: '{{ embedded_indoor_temperature }}' continue_on_error: true