v4.3dev2 - Selectable pages for bar buttons

Supports #168
Solves #1517
Solves #1507
This commit is contained in:
Edward Firmo
2024-03-03 22:24:29 +01:00
parent c272d56219
commit 536410615e
12 changed files with 109 additions and 24 deletions

View File

@@ -18,7 +18,7 @@ substitutions:
temp_units: "°C"
invalid_cooldown: "100ms"
##### DON'T CHANGE THIS ######
version: "4.3dev1"
version: "4.3dev2"
##############################
##### External components #####
@@ -339,6 +339,7 @@ api:
relay2_fallback: bool # Fallback state for Relay 2 in case of communication loss.
button_left: bool # Enable/disable left button status visualization.
button_right: bool # Enable/disable right button status visualization.
button_bar_pages: int # As uint representing the list of pages where the buttons bars will be visible
button_bar_color_on: int[] # RGB color array for the hardware button bar when the status is `On`.
button_bar_color_off: int[] # RGB color array for the hardware button bar when the status is `Off`.
embedded_climate: bool # Indicates if climate control is integrated.
@@ -384,6 +385,7 @@ api:
refresh_relays->execute();
// Buttons bars settings
id(buttons_bars_pages) = button_bar_pages;
update_bitwise_setting(id(buttons_settings), button_left, ButtonSettings::ButtonLeft_Enabled);
update_bitwise_setting(id(buttons_settings), button_right, ButtonSettings::ButtonRight_Enabled);
@@ -910,6 +912,11 @@ globals:
restore_value: true
initial_value: '10597'
- id: buttons_bars_pages
type: uint32_t
restore_value: true
initial_value: '1'
####### Relay settings #######
# Bit # Settings #
# 0 # Relay 1 - Local #
@@ -2383,7 +2390,7 @@ script:
mode: restart
then:
- lambda: |-
if (!id(is_uploading_tft)) {
if (!id(is_uploading_tft) and ((id(buttons_bars_pages) & (1 << get_page_id(current_page->state.c_str()))) != 0)) {
switch (int(display_mode->state)) {
case 1: // EU model
if (id(buttons_settings) & nspanel_ha_blueprint::ButtonSettings::ButtonLeft_Enabled) { // Left button