diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 0570f9a..a3fc2ea 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -4132,10 +4132,10 @@ variables: settings: reboot: Reiniciar sleep: Dormir - brightness: Brillante # Change to "Brillo" when new format is implemented - PR#1023 + brightness: Brillo bright: Brillante dimming: Atenuación - dim: Oscurecer + dim: Oscuro et: #Estonian weekdays: mon: Esmaspäev @@ -4700,8 +4700,8 @@ variables: settings: reboot: Riavvio sleep: Modalità ECO - brightness: "In uso:" #Luminosità - bright: "In uso:" #( If the meaning is "Bright Mode" you can also say "Modalità Luminosa) + brightness: Luminosità + bright: Modalità Luminosa dimming: Regolazione dim: Reg. lt: #Lithuanian @@ -5046,19 +5046,19 @@ variables: unavailable: Niedostępny no_name: Bez nazwy alarm: - home: home - away: away - night: night - vacation: vacation - bypass: bypass - disarm: disarm + home: Dom + away: Poza domem + night: Noc + vacation: Wakacje + bypass: Bypass + disarm: Rozbojenie settings: - reboot: Reboot - sleep: Sleep - brightness: Brightness - bright: Bright - dimming: Dimming - dim: Dim + reboot: Restartuj + sleep: Usypianie + brightness: Jasność + bright: Jasny + dimming: Ściemnianie + dim: Ciemny pt: #Portuguese weekdays: mon: Segunda-feira @@ -5128,7 +5128,7 @@ variables: sleep: Dormir brightness: Brilho bright: Normal - dimming: Escuro + dimming: Escurecer dim: Escuro ro: #Romanian weekdays: @@ -5408,12 +5408,12 @@ variables: bypass: Območje izlopljeno disarm: Izklop settings: - reboot: Reboot - sleep: Sleep - brightness: Brightness - bright: Bright - dimming: Dimming - dim: Dim + reboot: Ponovni zagon + sleep: Spanje + brightness: Osvetlitev + bright: Svetlo + dimming: Zatemnitev + dim: Temno sv: #Swedish weekdays: mon: Måndag @@ -6469,7 +6469,8 @@ action: reboot: '{{ mui[language].settings.reboot }}' sleep_mode: '{{ mui[language].settings.sleep }}' brightness: '{{ mui[language].settings.brightness }}' - dimming: '{{ mui[language].settings.dimming }}' + bright: '{{ mui[language].settings.bright }}' + dim: '{{ mui[language].settings.dim }}' continue_on_error: true - *delay-default diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index f9f6ddc..2f7a2bb 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -366,21 +366,13 @@ api: id(set_component_color).execute(btnicon.c_str(), btn_icon_font, btn_bg); id(set_component_color).execute(btntext.c_str(), btn_txt_font, btn_bg); id(set_component_color).execute(btnbri.c_str(), btn_bri_font, btn_bg); - //id(disp1).set_component_background_color(btnicon.c_str(), btn_bg); - //id(disp1).set_component_background_color(btntext.c_str(), btn_bg); - //id(disp1).set_component_background_color(btnbri.c_str(), btn_bg); - //id(disp1).set_component_font_color(btnicon.c_str(), btn_icon_font); - //id(disp1).set_component_font_color(btntext.c_str(), btn_txt_font); - //id(disp1).set_component_font_color(btnbri.c_str(), btn_bri_font); id(disp1).set_component_text_printf(btnicon.c_str(), "%s", btn_icon.c_str()); - //id(disp1).set_component_text_printf(btntext.c_str(), "%s", btn_label.c_str()); id(display_wrapped_text).execute(btntext.c_str(), btn_label.c_str(), 10); - // id(disp1).set_component_text_printf(btnbri.c_str(), "%s", btn_bri_txt.c_str()); - if (strcmp(btn_bri_txt.c_str(), "0") != 0) { + if (strcmp(btn_bri_txt.c_str(), "0") != 0) id(disp1).set_component_text_printf(btnbri.c_str(), "%s", btn_bri_txt.c_str()); - } else { + else id(disp1).set_component_text_printf(btnbri.c_str(), " "); - } + ##### SERVICE TO WAKE UP THE DISPLAY ##### - service: wake_up @@ -587,18 +579,21 @@ api: reboot: string sleep_mode: string brightness: string - dimming: string + bright: string + dim: string then: - lambda: |- ESP_LOGV("service.page_settings", "Starting"); ESP_LOGV("service.page_settings", "reboot: %s", reboot.c_str()); ESP_LOGV("service.page_settings", "sleep_mode: %s", sleep_mode.c_str()); ESP_LOGV("service.page_settings", "brightness: %s", brightness.c_str()); - ESP_LOGV("service.page_settings", "dimming: %s", dimming.c_str()); + ESP_LOGV("service.page_settings", "bright: %s", bright.c_str()); + ESP_LOGV("service.page_settings", "dim: %s", dim.c_str()); if (not reboot.empty()) id(disp1).set_component_text_printf("settings.lbl_reboot", " %s", reboot.c_str()); if (not sleep_mode.empty()) id(disp1).set_component_text_printf("settings.lbl_sleep", " %s", sleep_mode.c_str()); - if (not brightness.empty()) id(disp1).set_component_text_printf("settings.lbl_brightness", "%s", brightness.c_str()); - if (not dimming.empty()) id(disp1).set_component_text_printf("settings.lbl_dimming", "%s", dimming.c_str()); + id(display_wrapped_text).execute("settings.lbl_brightness", brightness.c_str(), id(display_mode) == 2 ? 25 : 10); + id(display_wrapped_text).execute("settings.lbl_bright", bright.c_str(), id(display_mode) == 2 ? 25 : 10); + id(display_wrapped_text).execute("settings.lbl_dim", dim.c_str(), id(display_mode) == 2 ? 25 : 10); #### Service to populate the alarm settings page ##### - service: alarm_settings @@ -1158,14 +1153,7 @@ text_sensor: else if (page=="buttonpage02" or page=="entitypage02") id(disp1).set_component_text_printf("page_index", "%s", "\uE765\uE764\uE765\uE765"); // 2/4 else if (page=="buttonpage03" or page=="entitypage03") id(disp1).set_component_text_printf("page_index", "%s", "\uE765\uE765\uE764\uE765"); // 3/4 else if (page=="buttonpage04" or page=="entitypage04") id(disp1).set_component_text_printf("page_index", "%s", "\uE765\uE765\uE765\uE764"); // 4/4 - else if (page=="settings") - { - ESP_LOGV("text_sensor.nspanelevent", "Construct settings page"); - //id(disp1).set_component_text_printf("bt_reboot", "%s", "\uE708"); //mdi:restart - id(disp1).set_component_text_printf("bt_sleep", "%s", (id(sleep_mode).state) ? "\uEA19" : "\uEA18"); //mdi:toggle-switch-outline or mdi:toggle-switch-off-outline - id(disp1).set_component_text_printf("icon_bright", "%s", "\uE0DD"); //mdi:brightness-5 - id(disp1).set_component_text_printf("icon_dim", "%s", "\uE0DE"); //mdi:brightness-5 - } + else if (page=="settings") id(disp1).set_component_text_printf("bt_sleep", "%s", (id(sleep_mode).state) ? "\uEA19" : "\uEA18"); //mdi:toggle-switch-outline or mdi:toggle-switch-off-outline else if (page=="notification") { if (not id(confirmation_message).state) @@ -1290,11 +1278,11 @@ text_sensor: #name: ${device_name} touchevent component_name: touchevent internal: true - filters: - - lambda: |- - x = x.c_str(); - x.shrink_to_fit(); - return x; + #filters: + # - lambda: |- + # x = x.c_str(); + # x.shrink_to_fit(); + # return x; on_value: then: - lambda: |- diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index 1ae8ecc..b249602 100644 Binary files a/nspanel_eu.HMI and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft index 36e0944..ac3a2e6 100644 Binary files a/nspanel_eu.tft and b/nspanel_eu.tft differ diff --git a/nspanel_eu_code/media_player.txt b/nspanel_eu_code/media_player.txt new file mode 100644 index 0000000..e69de29 diff --git a/nspanel_eu_code/settings.txt b/nspanel_eu_code/settings.txt index 08b5886..10e4c6f 100644 --- a/nspanel_eu_code/settings.txt +++ b/nspanel_eu_code/settings.txt @@ -80,45 +80,35 @@ Text lbl_sleep Text : Sleep mode Max. Text Size : 25 -Text lbl_brightness +Text lbl_bright Attributes ID : 7 Scope : global Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : Brightness - Max. Text Size : 10 + Text : Bright + Max. Text Size : 25 -Text lbl_dimming +Text lbl_dim Attributes ID : 8 Scope : global Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : Dimming - Max. Text Size : 7 + Text : Dim + Max. Text Size : 25 -Text icon_bright +Text lbl_brightness Attributes ID : 16 - Scope : local + Scope : global Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : - Max. Text Size : 3 - -Text icon_dim - Attributes - ID : 17 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : - Max. Text Size : 3 + Text : Brightness + Max. Text Size : 25 Slider brightslider Attributes @@ -223,6 +213,7 @@ Hotspot bt_bright_down { brightslider.val-- covx brightslider.val,bright_text.txt,0,0 + bright_text.txt+="%" printh 91 prints "brightslider",0 printh 00 @@ -243,6 +234,7 @@ Hotspot bt_bright_up { brightslider.val++ covx brightslider.val,bright_text.txt,0,0 + bright_text.txt+="%" printh 91 prints "brightslider",0 printh 00 @@ -263,6 +255,7 @@ Hotspot bt_dim_down { dimslider.val-- covx dimslider.val,dim_text.txt,0,0 + dim_text.txt+="%" printh 91 prints "dimslider",0 printh 00 @@ -283,6 +276,7 @@ Hotspot bt_dim_up { dimslider.val++ covx dimslider.val,dim_text.txt,0,0 + dim_text.txt+="%" printh 91 prints "dimslider",0 printh 00 diff --git a/nspanel_us.HMI b/nspanel_us.HMI index a116329..e20f440 100644 Binary files a/nspanel_us.HMI and b/nspanel_us.HMI differ diff --git a/nspanel_us.tft b/nspanel_us.tft index 9c525fa..594b4dd 100644 Binary files a/nspanel_us.tft and b/nspanel_us.tft differ diff --git a/nspanel_us_code/settings.txt b/nspanel_us_code/settings.txt index 2096ae4..097c5bd 100644 --- a/nspanel_us_code/settings.txt +++ b/nspanel_us_code/settings.txt @@ -80,46 +80,132 @@ Text lbl_sleep Text : Sleep mode Max. Text Size : 25 -Text lbl_brightness +Text lbl_bright Attributes ID : 7 Scope : global Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : Brightness - Max. Text Size : 10 + Text : Bright + Max. Text Size : 25 -Text lbl_dimming +Text lbl_dim Attributes ID : 8 Scope : global Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : Dimming - Max. Text Size : 7 + Text : Dim + Max. Text Size : 25 -Text icon_bright +Text lbl_brightness Attributes ID : 16 - Scope : local + Scope : global Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : - Max. Text Size : 3 + Text : Brightness + Max. Text Size : 25 -Text icon_dim +Text t0 Attributes ID : 17 Scope : local Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : - Max. Text Size : 3 + Text :  + Max. Text Size : 10 + Events + Touch Release Event + if(brightslider.val<100) + { + brightslider.val++ + covx brightslider.val,bright_text.txt,0,0 + bright_text.txt+="%" + printh 91 + prints "brightslider",0 + printh 00 + prints brightslider.val,0 + printh FF FF FF + } + +Text t1 + Attributes + ID : 18 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text :  + Max. Text Size : 10 + + Events + Touch Release Event + if(dimslider.val<100) + { + dimslider.val++ + covx dimslider.val,dim_text.txt,0,0 + dim_text.txt+="%" + printh 91 + prints "dimslider",0 + printh 00 + prints dimslider.val,0 + printh FF FF FF + } + +Text t2 + Attributes + ID : 19 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text :  + Max. Text Size : 10 + + Events + Touch Release Event + if(dimslider.val>0) + { + dimslider.val-- + covx dimslider.val,dim_text.txt,0,0 + dim_text.txt+="%" + printh 91 + prints "dimslider",0 + printh 00 + prints dimslider.val,0 + printh FF FF FF + } + +Text t3 + Attributes + ID : 20 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text :  + Max. Text Size : 10 + + Events + Touch Release Event + if(brightslider.val>0) + { + brightslider.val-- + covx brightslider.val,bright_text.txt,0,0 + bright_text.txt+="%" + printh 91 + prints "brightslider",0 + printh 00 + prints brightslider.val,0 + printh FF FF FF + } + Slider brightslider Attributes ID : 1 @@ -223,6 +309,7 @@ Hotspot bt_bright_down { brightslider.val-- covx brightslider.val,bright_text.txt,0,0 + bright_text.txt+="%" printh 91 prints "brightslider",0 printh 00 @@ -243,6 +330,7 @@ Hotspot bt_bright_up { brightslider.val++ covx brightslider.val,bright_text.txt,0,0 + bright_text.txt+="%" printh 91 prints "brightslider",0 printh 00 @@ -263,6 +351,7 @@ Hotspot bt_dim_down { dimslider.val-- covx dimslider.val,dim_text.txt,0,0 + dim_text.txt+="%" printh 91 prints "dimslider",0 printh 00 @@ -283,6 +372,7 @@ Hotspot bt_dim_up { dimslider.val++ covx dimslider.val,dim_text.txt,0,0 + dim_text.txt+="%" printh 91 prints "dimslider",0 printh 00 diff --git a/nspanel_us_land.HMI b/nspanel_us_land.HMI index 4f1ad4e..4e0fa33 100644 Binary files a/nspanel_us_land.HMI and b/nspanel_us_land.HMI differ diff --git a/nspanel_us_land.tft b/nspanel_us_land.tft index bf81602..ff59cda 100644 Binary files a/nspanel_us_land.tft and b/nspanel_us_land.tft differ diff --git a/nspanel_us_land_code/settings.txt b/nspanel_us_land_code/settings.txt index db740b0..d788592 100644 --- a/nspanel_us_land_code/settings.txt +++ b/nspanel_us_land_code/settings.txt @@ -80,45 +80,35 @@ Text lbl_sleep Text : Sleep mode Max. Text Size : 25 -Text lbl_brightness +Text lbl_bright Attributes ID : 7 Scope : global Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : Brightness - Max. Text Size : 10 + Text : Bright + Max. Text Size : 25 -Text lbl_dimming +Text lbl_dim Attributes ID : 8 Scope : global Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : Dimming - Max. Text Size : 7 + Text : Dim + Max. Text Size : 25 -Text icon_bright +Text lbl_brightness Attributes ID : 16 - Scope : local + Scope : global Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : - Max. Text Size : 3 - -Text icon_dim - Attributes - ID : 17 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : - Max. Text Size : 3 + Text : Brightness + Max. Text Size : 25 Slider brightslider Attributes @@ -223,6 +213,7 @@ Hotspot bt_bright_down { brightslider.val-- covx brightslider.val,bright_text.txt,0,0 + bright_text.txt+="%" printh 91 prints "brightslider",0 printh 00 @@ -243,6 +234,7 @@ Hotspot bt_bright_up { brightslider.val++ covx brightslider.val,bright_text.txt,0,0 + bright_text.txt+="%" printh 91 prints "brightslider",0 printh 00 @@ -263,6 +255,7 @@ Hotspot bt_dim_down { dimslider.val-- covx dimslider.val,dim_text.txt,0,0 + dim_text.txt+="%" printh 91 prints "dimslider",0 printh 00 @@ -283,6 +276,7 @@ Hotspot bt_dim_up { dimslider.val++ covx dimslider.val,dim_text.txt,0,0 + dim_text.txt+="%" printh 91 prints "dimslider",0 printh 00