From 019a882fe97f6c52ad5b8b5ecb0b5a020a74c10d Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Mon, 4 Dec 2023 16:05:26 +0100 Subject: [PATCH 01/16] Bump version to 4.1.4 --- ReleaseNotes.md | 10 ++++-- nspanel_blueprint.yaml | 34 ++++++++++++------- nspanel_esphome_addon_climate_base.yaml | 12 ++++--- nspanel_esphome_addon_climate_cool.yaml | 12 ++++--- nspanel_esphome_addon_climate_heat.yaml | 12 ++++--- nspanel_esphome_addon_upload_tft.yaml | 2 ++ nspanel_esphome_advanced.yaml | 2 +- nspanel_esphome_core.yaml | 42 +++++++++++++----------- nspanel_eu.HMI | Bin 14899044 -> 14899044 bytes nspanel_eu.tft | Bin 7247932 -> 7247932 bytes nspanel_eu_code/boot.txt | 2 +- nspanel_us.HMI | Bin 14731244 -> 14731244 bytes nspanel_us.tft | Bin 7255544 -> 7255544 bytes nspanel_us_code/boot.txt | 2 +- nspanel_us_land.HMI | Bin 14515341 -> 14515341 bytes nspanel_us_land.tft | Bin 7247932 -> 7247932 bytes nspanel_us_land_code/boot.txt | 2 +- 17 files changed, 83 insertions(+), 49 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index cee6dc8..c95cf38 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -19,9 +19,9 @@ So at this release we concentrated on cleaning up de code everywhere and shave s Since in this update lots of input to the blueprint changed, we highly recommend you review your settings and make sure all fields have the correct selection. We did our best to support your legacy settings and avoid breaking your system, but please double check your settings if you see something not working as expected. ### Files that need to be reloaded: -1. nspanel_eu.tft, nspanel_us.tft or nspanel_us_land.tft - v4.1.2 -2. nspanel_esphome.yaml - v4.1.2 -3. nspanel_blueprint.yaml - v4.1.2 +1. nspanel_eu.tft, nspanel_us.tft or nspanel_us_land.tft - v4.1.4 +2. nspanel_esphome.yaml - v4.1.4 +3. nspanel_blueprint.yaml - v4.1.4 #### @@ -103,6 +103,10 @@ packages: - Upload TFT remove dependency to from ESPHome Nextion component - Fix light icon color on buttons - Fix climate page not updating properly +- 4.1.4 patch: + - Supports new `weather.get_forecasts` introduced by Home Assistant 2023.12.0 + - Manual line break on multiline text with `\r` +   ## Details of noteworthy changes diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 310252d..a220416 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -1,6 +1,9 @@ -############################################################# -##### START - INPUT ##### -############################################################# +####################################################################################################### +##### NSPANEL Blueprint created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint ##### +##### Blueprint ##### +##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### +##### For normal use with the Blueprint, no changes are necessary. ##### +####################################################################################################### blueprint: name: NSPanel Configuration @@ -33,7 +36,7 @@ blueprint: 🎉 Roadmap can be found here: [Roadmap](https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap) - ℹ️ Version: v4.1.3 + ℹ️ Version: v4.1.4 source_url: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/nspanel_blueprint.yaml domain: automation @@ -3599,7 +3602,7 @@ trigger_variables: variables: ##### GENERAL ##### - blueprint_version: '4.1.3' + blueprint_version: '4.1.4' date_format_temp: !input 'date_format' #Avoid breaking change for existing users with legacy type format date_format: > @@ -8581,7 +8584,14 @@ action: - *delay-default ##### Display weather data only when available ##### - - service: weather.get_forecast + - variables: + ha_core_update_entity: > + {% for u in integration_entities("hassio") | select("search", "^update[.]") if (device_attr(u, "identifiers") | first)[1] == "core" %} + {{ u }} + {% endfor %} + ha_core_current_version: '{{ state_attr(ha_core_update_entity, "installed_version") }}' + use_new_forecasts: '{{ ha_core_current_version | version >= "2023.12.0b1" if ha_core_current_version else false }}' + - service: '{{ "weather.get_forecasts" if use_new_forecasts else "weather.get_forecast" }}' target: entity_id: '{{ weather_entity }}' data: @@ -8590,11 +8600,13 @@ action: continue_on_error: true - variables: forecast: > - {{ - service_response_var.forecast - if service_response_var is defined and service_response_var.forecast is defined - else state_attr(weather_entity, "forecast") | default(false) - }} + {% if use_new_forecasts and service_response_var is defined and service_response_var[weather_entity] is defined and service_response_var[weather_entity].forecast is defined %} + {{ service_response_var[weather_entity].forecast }} + {% elif service_response_var is defined and service_response_var.forecast is defined %} + {{ service_response_var.forecast }} + {% else %} + {{ state_attr(weather_entity, "forecast") | default(false) }} + {% endif %} - condition: '{{ forecast != false }}' - variables: datetime_is_string: '{{ forecast[0] is defined and forecast[0]["datetime"] is string }}' diff --git a/nspanel_esphome_addon_climate_base.yaml b/nspanel_esphome_addon_climate_base.yaml index 2bf121d..7c6e514 100644 --- a/nspanel_esphome_addon_climate_base.yaml +++ b/nspanel_esphome_addon_climate_base.yaml @@ -1,7 +1,11 @@ -#################################################################################################### -##### NSPanel ESPHome Add-on for Climate control - Shared - This will be called by heat/cool ##### -##### Add-on for https://github.com/Blackymas/NSPanel_HA_Blueprint ##### -#################################################################################################### +##################################################################################################### +##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint ##### +##### ESPHome Add-on for Climate control - Shared - This will be called by heat/cool ##### +##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### +##### For normal use with the Blueprint, no changes are necessary. ##### +##################################################################################################### +##### ATTENTION: This will add climate elements to the core system and requires the core part. ##### +##################################################################################################### substitutions: ### Local thermostat defaults ### diff --git a/nspanel_esphome_addon_climate_cool.yaml b/nspanel_esphome_addon_climate_cool.yaml index a61fbbc..f887e45 100644 --- a/nspanel_esphome_addon_climate_cool.yaml +++ b/nspanel_esphome_addon_climate_cool.yaml @@ -1,7 +1,11 @@ -#################################################################################################### -##### NSPanel ESPHome Add-on for Climate control - Cool ##### -##### Add-on for https://github.com/Blackymas/NSPanel_HA_Blueprint ##### -#################################################################################################### +##################################################################################################### +##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint ##### +##### ESPHome Add-on for Climate control - Cool ##### +##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### +##### For normal use with the Blueprint, no changes are necessary. ##### +##################################################################################################### +##### ATTENTION: This will add climate elements to the core system and requires the core part. ##### +##################################################################################################### substitutions: ### Local thermostat defaults ### diff --git a/nspanel_esphome_addon_climate_heat.yaml b/nspanel_esphome_addon_climate_heat.yaml index 4c7ddc3..eab575d 100644 --- a/nspanel_esphome_addon_climate_heat.yaml +++ b/nspanel_esphome_addon_climate_heat.yaml @@ -1,7 +1,11 @@ -#################################################################################################### -##### NSPanel ESPHome Add-on for Climate control - Heat ##### -##### Add-on for https://github.com/Blackymas/NSPanel_HA_Blueprint ##### -#################################################################################################### +##################################################################################################### +##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint ##### +##### ESPHome Add-on for Climate control - Heat ##### +##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### +##### For normal use with the Blueprint, no changes are necessary. ##### +##################################################################################################### +##### ATTENTION: This will add climate elements to the core system and requires the core part. ##### +##################################################################################################### substitutions: ### Local thermostat defaults ### diff --git a/nspanel_esphome_addon_upload_tft.yaml b/nspanel_esphome_addon_upload_tft.yaml index 5158756..2f149ae 100644 --- a/nspanel_esphome_addon_upload_tft.yaml +++ b/nspanel_esphome_addon_upload_tft.yaml @@ -4,6 +4,8 @@ ##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### ##### For normal use with the Blueprint, no changes are necessary. ##### ##################################################################################################### +##### ATTENTION: This will add advanced elements to the core system and requires the core part. ##### +##################################################################################################### substitutions: diff --git a/nspanel_esphome_advanced.yaml b/nspanel_esphome_advanced.yaml index dfb2e06..d0b0ab1 100644 --- a/nspanel_esphome_advanced.yaml +++ b/nspanel_esphome_advanced.yaml @@ -1,6 +1,6 @@ ##################################################################################################### ##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint ##### -##### ADVANCED CONFIG + FULL ESPHOME CODE! ##### +##### ESPHOME ADVANCED ##### ##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### ##### For normal use with the Blueprint, no changes are necessary. ##### ##################################################################################################### diff --git a/nspanel_esphome_core.yaml b/nspanel_esphome_core.yaml index 9959780..a1d4bc2 100644 --- a/nspanel_esphome_core.yaml +++ b/nspanel_esphome_core.yaml @@ -1,13 +1,13 @@ ##################################################################################################### ##### NSPANEL ESPHOME created by Blackymas - https://github.com/Blackymas/NSPanel_HA_Blueprint ##### -##### ADVANCED CONFIG + FULL ESPHOME CODE! ##### +##### ESPHOME CORE ##### ##### PLEASE only make changes if it is necessary and also the required knowledge is available. ##### ##### For normal use with the Blueprint, no changes are necessary. ##### ##################################################################################################### substitutions: ##### DON'T CHANGE THIS ##### - version: "4.1.3" + version: "4.1.4" ############################# #external_components: @@ -2094,23 +2094,27 @@ script: int startPos = 0; int endPos = 0; std::string wrappedText = ""; - while (startPos < text_to_display.length()) { - while (text_to_display[startPos] == ' ' and startPos < text_to_display.length()) { startPos++; } - int endPos = startPos + line_length_limit; - if (endPos >= text_to_display.length()) endPos = text_to_display.length(); - else - { - while (endPos > startPos && text_to_display[endPos] != ' ') { endPos--; } - if (endPos == startPos) endPos = startPos + line_length_limit; // Handle case of long word - } - wrappedText += text_to_display.substr(startPos, endPos-startPos); - if (endPos < text_to_display.length()) - { - while (text_to_display[endPos] == ' ') { endPos--; } - if (endPos >= startPos) wrappedText += "\\r"; - } - startPos = endPos + 1; // Skip the space - while (text_to_display[startPos] == ' ' and startPos < text_to_display.length()) { startPos++; } + if (text_to_display.find("\\r") != std::string::npos) { + wrappedText = text_to_display; + } else { + while (startPos < text_to_display.length()) { + while (text_to_display[startPos] == ' ' and startPos < text_to_display.length()) { startPos++; } + int endPos = startPos + line_length_limit; + if (endPos >= text_to_display.length()) endPos = text_to_display.length(); + else + { + while (endPos > startPos && text_to_display[endPos] != ' ') { endPos--; } + if (endPos == startPos) endPos = startPos + line_length_limit; // Handle case of long word + } + wrappedText += text_to_display.substr(startPos, endPos-startPos); + if (endPos < text_to_display.length()) + { + while (text_to_display[endPos] == ' ') { endPos--; } + if (endPos >= startPos) wrappedText += "\\r"; + } + startPos = endPos + 1; // Skip the space + while (text_to_display[startPos] == ' ' and startPos < text_to_display.length()) { startPos++; } + } } disp1->set_component_text_printf(component.c_str(), "%s", wrappedText.c_str()); diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index e495a49fc40de7622b939f9456f70f66dfc2282c..10243e1e2c54ea041696cbf01c96360bfdad94ff 100644 GIT binary patch delta 989 zcmd7NS#OMS6vy%B(HUJ5cTdtQ7kVuciKNs{(V`g2*!_#5XtkCO9ZTttQPk4G*tNB9 zZJ9F0-px`wwN`EEmBveu_)5G6agxv7NzV6lRF}nepf=O)Ze``<^-9Y~xBgDFXTDY8 zwk#XD!2&zcw!)=$a-7{eSRbDlV>Q(T+v1yTD_EJ3XxrgvLLlDN@GGUf#Nz}!j*Tve zfeUVQjd+~cn$Dncy4A(~%Znw(2^f+LNrogtk|D{EWSrQF&i`Q{Y@DCj>Z^WAQGX54 zKn>Dh4be~y({QC~ghpzV(v+^z8l$nw&^V3P1bH-3la#5+nj){JYMQ2NhGuG(W^0a& zvNTuoG+)_TpoLnb94*!oEmf}av`qOb&~mNNO0801oiEkvZfs3z@P}Ib{^Urp*O#1R z_X+j*QFu0BihNj&H7J4~Yq1XNu>r-{h)pPguo+trz*dxE8@6Ky%CHl=up4_&jv)48 zANC`J12~97IE*7WieosA3RI#BCvXy{a2jXu=Z|wZj|;enOQ=Q-YH=A?5JnxY;u<2j zjwo*6CT`(2?%*!&p&kurL=&2E9}n;lkI;h0c!H;RhUa*Jmw1KOXvG`6#XG#m2Yf^u TKA|0-@daP;Enc z!*T3ImMqz~WSg!uZu|w_&G;LP@67AsnR#ZO_qVO4+}(z{bgNr#R!&~8lvJg`k|dMsBcnix!ob!rN`27GqVXItom z7{nqDog+TmUEA&$yGuC!UtSCtJ7`EUBpH$nNrogtlCj;D?f=6<$k@NK)mQ!0UjsBy zgEUw}G*rVhTqBgMks77ZN|9G%G*;u3s_~kjiSlWZ(v+^r%21}JXsV`Zx@KsmW@)yJ zvNT6?HBZ@^uLWAD94*pfEm5xWv{d;j&@vTjxmKtsT%4R4m-gG6;jd`&`;#K2nZ-#x ztUeXpe-@nynv!Cy#441)kJVU%wOEHztj7ifAZ)}Y1hE-q*n+LthH`Aj4(!A(?1qCq z*o%FrzLnW$EjpI0hlQ@Ob==jH3oWprsz(v%c7InCU%LpNiE4YdX zt|5x+xPhCvh1X&wYB%AwKqkLy0zy!_;C`C;3*^|5(!@A{_rNglbqN4 z=j7M$T9OZvMWjfTCS8V1A7#mwBiAQ+@)amlWPw6=-S+ delta 273 zcmWN=S56dA006*H7U@!DSrC`rrArZz-g_?!ORwI6k4ZQJ*YLx{M7RT7VDG}4WM2OK zPkRX;q)3$}T||ZtGG)n@BUhe$9~CH6q*#ekpOlFz7gM3qXH~w4t5%~{oq7!#HEGtO zRhxESb?DTkTaR9SzUen$(2(zjjTrUAm~j&(O_?@h)|`0@7A;w}V%3^;8#Zm(wqw_x zeFqNx^vjXszllgPrROP@OvE1J$wYV(o`z@Pd3X_ChF9TrcoW`+cj5iNc=C7jIsL7? G==B{FU1@ay diff --git a/nspanel_eu_code/boot.txt b/nspanel_eu_code/boot.txt index dab95f5..9f168f3 100644 --- a/nspanel_eu_code/boot.txt +++ b/nspanel_eu_code/boot.txt @@ -142,7 +142,7 @@ Text tft_version Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : 4.1.3 + Text : 4.1.4 Max. Text Size : 9 Text esph_version diff --git a/nspanel_us.HMI b/nspanel_us.HMI index 511511b4b93c232d97cce493f89179aec790867b..3f2975fc8d0d77bf843dd9c64d176f8af23d43ed 100644 GIT binary patch delta 1022 zcmd7M=~K*c0LStDsZ|f+iQh08k382*GiGw+zKX&+a`Rgxp=@&QT4XRg6lt1L3Q8AiC&h#AQR z&iulZjOg`YT-nG*E*ySVJ^a!!%qYG*Y9Kp-hd|7-cD2V>M3W<^OdUw%F{ySYmpXfi3(JxrE;lA%T%o8TA`I%rPW#^ zw>(-K@#fUnyH>Pz@dQIn{pfz zIEhm@jWallb2yJ$)ZqdyB8&(w;WDDQf~&ZO>!`;K+{7*1#vR16wG~gi~;W3`z nDW2guUZ4>#@d{07#%sL6TfD=2wBQ3i;uAjOOSHKqmi+w>xi#kG delta 1022 zcmd7M=~K)B9LMqBPpx_okA5?z88c=)G^3e33FW?u!a8#ETMD6Ua+am+$F5w(mK9>% zw_;-*xv!j2u3Y=jgThlYo_L$#f9N~&n(vd(gLg-TH?9NqZqv*U6q-FuBV2Aq%|yeM zSCEvRm0|q5zTezN$YB^}xGd&(yqO&EB>df0Cq&JjMskwd^?%6EuJsrtX>6N%8R5$A z^^Vxonw&mfr{#BACb}R7v2dVk#A(IVwFhjgTSI&&2=UsM-=@^2)TY#?)TY#?)VAV6 z?VVu|wyp2E>aPJBs8pqCkOpgrhH99GYlKE>ltyce(v_jH8mCNUX}l(AqMVwf$(o|6 z%GNYZ*9^_nEX~#&&DA{Fa%sL6C`Y+ks6|?=JT1{uEmOVKrIg95JEVNBRGmTh(~ygCOpAY oJi~Lmz)Lja6<(tSt$2gCc!&4+fHr)@Cw#^ie2uiWMH7Gg0e5rdmjD0& diff --git a/nspanel_us.tft b/nspanel_us.tft index 63e7e5e6132f681d8c8246104c7fbf5dfc10a66b..069d2b74be3c35231266b70fb864fcb01696689b 100644 GIT binary patch delta 273 zcmWN=$4(Pq007{W7KAb^vWp@J%HCzVL1nlY3Y1y)eg_U;;v@JXBqSbq37&w4gNbL7 z9{s=M%l-Qk&4m{t@6OF5PeFw)pp+rQMvNLW?xj~=d*iKl-kUJ#gO5I$GHu4J&%XHToA2h# zTd?SdpO!3Jk+y2hx(%DQE;IMHk<{;aHk167$Y#Rra3|ai_rm?~AUq6@!sGBHJPpsT O64~>+o7mrU?)pDN^lZcc delta 273 zcmWN=M@|$_007X?o50X<6h!GA96+j4EcD*%P*mz2SiHm|xZxNiCftFr-~>$A;nswu z|0VDF=_chlyp$waid1RRWyq8zTaFiU<;fROpiq%wB}$bk_fpg=uT`k@MwPeTsaB&_ zoq7!#HEGtORhxDlI=vUurCW~=diCiyV9=0{J{dM*)R@n{`0AT+6DCcWHe=SDc?%XT zS+-);nspmCZP~VC*WPvf-$PRDcXlEk{S`^X!~O6eJPeP*@8OT|XLuZ*gs0(Ic>X7n NxOluzz5RQ4^&dotZ14a8 diff --git a/nspanel_us_code/boot.txt b/nspanel_us_code/boot.txt index dab95f5..9f168f3 100644 --- a/nspanel_us_code/boot.txt +++ b/nspanel_us_code/boot.txt @@ -142,7 +142,7 @@ Text tft_version Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : 4.1.3 + Text : 4.1.4 Max. Text Size : 9 Text esph_version diff --git a/nspanel_us_land.HMI b/nspanel_us_land.HMI index 21fbc4021e57c9ef9cd8bb8fa46ae8b7123a78a2..ceccc36d17bb4db591be42b966281eef97a09ae2 100644 GIT binary patch delta 1046 zcmdVY*;CD79LMqBFQ;WRW6qs1lbim4W}2a~gcG3q?LQR~u|T-@1bhI;qt8RqJq@vXWf#_f-Bn-V77#3kVp;l#KjKezwiuP?FO zeoOHz#j_O8QanrXEXA|jk#+6=!iA9KE=#8${TaYO5*fr`hTtKIp$sFL;f!D;DWo!r z(TpLDv5dnao$*W{gNaNclgUhBD$|(G3}!Nm*?5`5T;?&K1uSF{SuAD=OUWjOT=H1P za`IV00W0ybiq)*4khK(1%sSSyfsK>^o7jw>EtImAZEPpN4t7$;F3PE3H+$GiB~|QW zKLMD_PD_%V8*BEd4A$BOj$P&}@8x{0@p+>C`i^o~j>u6tCdcK3 z)XGUYC8y<#oRxEOUM@(T1f^a=(jXV*k~nf%uE~2#Tkc4sG|64LC->!n qJd|d6B#-5Zw8&F=CeP)Cyp&dHlUMRu-pE^dC-3EhlU)2U_2(~<=W$p7 delta 1064 zcmdtgS#OMC7{>8;s>>u2nZ$wg)R~hemC;xREky_At`dN^qaFiF*Uw5m|=Cc*0nl&X7%xOy}lPE8|i7~#eXO0 zj%8U!l}AHjjYfK0ExWq2W<(u5dL`7jT>-btAqmn=5+zBJZMQ3>t>Zt5QDeFSrgECf zX)33woThS`%4xb%nmhi54^h(<&Z9pA7|0+z3}y&J$s~(m3@4irjARr!cp1$Y#*)i8 z#$%Gl1oD~4Bnl{GGDS>bD$|(G3}!NmVrDakxy)le3s^`Ai&)GOe3Vi~IZIha1q z1%6htiq%xHhP70)j`eI{BQ?M#HWOeALAJ7u?S$CDPQvV>mOAR$%^n)q%RcsVfP);O zk;5%kFvHf?XLe7_|KTmLLm5_CZ%5yTNRw4*TVa1~YCtO~N93p+ljCwiPD+!UlGAcV z&dNDCFBjyZG)qJ-NmN?ovRn~cuF5sJE;r<++>+aJNA60i+>`tAKpx5?c`Q#PCQs#= kw8?XMAur{Xyp}i8E^pFY0_ngh{}{D+Xp#veU#^ud<6;>`K(xpFG`gu7gM29m1;HOYSpRNpiz@%En2l{ z*P+u_UAleKqgS7P0|pHlHe%G6aT6v@nKonAoOuftEm^i=)tYr1Hf`CKuw&PreFwh# z;n0zve);XsQ!<)L>wAc$lCk@EDj6P!C*f)MH#`f^!;A1=co|-W*Wt}`Jat?48kzWC GnRo{iooQ77 delta 273 zcmWN=XEGdM007WYR+Ny{*D6^pg4Lq86ukw}yVWAv9sGDRj^G-8m@$K^>|OG`nfLzm zn)M#u%aAEcwul@b Date: Mon, 4 Dec 2023 16:19:25 +0100 Subject: [PATCH 02/16] Remove manual line break from page's title Solves #1367 --- nspanel_esphome_core.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nspanel_esphome_core.yaml b/nspanel_esphome_core.yaml index a1d4bc2..538c60f 100644 --- a/nspanel_esphome_core.yaml +++ b/nspanel_esphome_core.yaml @@ -226,6 +226,9 @@ api: // Alarm page - Header update_alarm_icon->execute("icon_state", state.c_str()); + if (page_title.find("\\r") != std::string::npos) { + page_title = page_title.replace(page_title.find("\\r"), 2, " "); + } disp1->set_component_text_printf("page_label", "%s", page_title.c_str()); disp1->set_component_text_printf("code_format", "%s", code_format.c_str()); if (code_arm_required) disp1->set_component_text_printf("code_arm_req", "1"); else disp1->set_component_text_printf("code_arm_req", "0"); @@ -432,6 +435,9 @@ api: detailed_entity->publish_state(entity); std::string cmd_page = std::string("page ") + page.c_str(); disp1->send_command_printf(cmd_page.c_str()); + if (page_label.find("\\r") != std::string::npos) { + page_label = page_label.replace(page_label.find("\\r"), 2, " "); + } disp1->set_component_text_printf("page_label", "%s", page_label.c_str()); disp1->set_component_text_printf("back_page", "%s", back_page.c_str()); if (page == "climate") From da4b64ed957b8982483fe0c95921c7597d93cd22 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Mon, 4 Dec 2023 22:19:03 +0100 Subject: [PATCH 03/16] Reorg files To make it easier for users --- .../nspanel_esphome_addon_climate_base.yaml | 0 .../nspanel_esphome_addon_climate_cool.yaml | 0 .../nspanel_esphome_addon_climate_heat.yaml | 0 .../nspanel_esphome_addon_upload_tft.yaml | 0 .../esphome/nspanel_esphome_advanced.yaml | 0 .../esphome/nspanel_esphome_core.yaml | 0 .../hmi}/nspanel_blank.HMI | Bin .../hmi}/nspanel_blank_code/Program.s.txt | 0 .../hmi}/nspanel_blank_code/blank.txt | 0 .../hmi}/nspanel_blank_code/page0.txt | 0 .../hmi}/nspanel_blank_code/screensaver.txt | 0 nspanel_eu.HMI => advanced/hmi/nspanel_eu.HMI | Bin .../hmi/nspanel_eu_code}/Program.s.txt | 52 +- .../hmi/nspanel_eu_code}/alarm.txt | 0 .../hmi/nspanel_eu_code}/boot.txt | 556 +- .../hmi/nspanel_eu_code}/buttonpage01.txt | 0 .../hmi/nspanel_eu_code}/buttonpage02.txt | 0 .../hmi/nspanel_eu_code}/buttonpage03.txt | 0 .../hmi/nspanel_eu_code}/buttonpage04.txt | 0 .../hmi/nspanel_eu_code}/climate.txt | 0 .../hmi/nspanel_eu_code}/confirm.txt | 0 .../hmi/nspanel_eu_code}/cover.txt | 486 +- .../hmi/nspanel_eu_code}/entitypage01.txt | 0 .../hmi/nspanel_eu_code}/entitypage02.txt | 0 .../hmi/nspanel_eu_code}/entitypage03.txt | 0 .../hmi/nspanel_eu_code}/entitypage04.txt | 0 .../hmi/nspanel_eu_code}/fan.txt | 0 .../hmi/nspanel_eu_code}/home.txt | 0 .../hmi/nspanel_eu_code}/keyb_num.txt | 0 .../hmi/nspanel_eu_code}/light.txt | 1418 +- .../hmi/nspanel_eu_code}/media_player.txt | 0 .../hmi/nspanel_eu_code}/notification.txt | 404 +- .../hmi/nspanel_eu_code}/pics/SinglePixel.png | Bin .../hmi/nspanel_eu_code}/power.page | Bin .../hmi/nspanel_eu_code}/power.txt | 0 .../hmi/nspanel_eu_code}/qrcode.txt | 296 +- .../hmi/nspanel_eu_code}/screensaver.txt | 82 +- .../hmi/nspanel_eu_code}/settings.txt | 0 .../hmi/nspanel_eu_code}/weather01.txt | 0 .../hmi/nspanel_eu_code}/weather02.txt | 0 .../hmi/nspanel_eu_code}/weather03.txt | 0 .../hmi/nspanel_eu_code}/weather04.txt | 0 .../hmi/nspanel_eu_code}/weather05.txt | 0 nspanel_us.HMI => advanced/hmi/nspanel_us.HMI | Bin .../hmi/nspanel_us_code}/Program.s.txt | 52 +- .../hmi/nspanel_us_code}/alarm.txt | 0 .../hmi/nspanel_us_code}/boot.txt | 556 +- .../hmi/nspanel_us_code}/buttonpage01.txt | 1574 +- .../hmi/nspanel_us_code}/buttonpage02.txt | 1574 +- .../hmi/nspanel_us_code}/buttonpage03.txt | 1574 +- .../hmi/nspanel_us_code}/buttonpage04.txt | 1574 +- .../hmi/nspanel_us_code}/climate.txt | 0 .../hmi/nspanel_us_code}/confirm.txt | 0 .../hmi/nspanel_us_code}/cover.txt | 486 +- .../hmi/nspanel_us_code}/entitypage01.txt | 790 +- .../hmi/nspanel_us_code}/entitypage02.txt | 790 +- .../hmi/nspanel_us_code}/entitypage03.txt | 790 +- .../hmi/nspanel_us_code}/entitypage04.txt | 790 +- .../hmi/nspanel_us_code}/fan.txt | 0 .../hmi/nspanel_us_code}/home.txt | 1248 +- .../hmi/nspanel_us_code}/keyb_num.txt | 0 .../hmi/nspanel_us_code}/light.txt | 1418 +- .../hmi/nspanel_us_code}/media_player.txt | 0 .../hmi/nspanel_us_code}/notification.txt | 424 +- .../hmi/nspanel_us_code}/nspanel_us_Stats.txt | 0 .../hmi/nspanel_us_code}/qrcode.txt | 296 +- .../hmi/nspanel_us_code}/screensaver.txt | 82 +- .../hmi/nspanel_us_code}/settings.txt | 880 +- .../hmi/nspanel_us_code}/weather01.txt | 584 +- .../hmi/nspanel_us_code}/weather02.txt | 584 +- .../hmi/nspanel_us_code}/weather03.txt | 584 +- .../hmi/nspanel_us_code}/weather04.txt | 584 +- .../hmi/nspanel_us_code}/weather05.txt | 584 +- .../hmi/nspanel_us_land.HMI | Bin .../hmi/nspanel_us_land_code}/Program.s.txt | 52 +- .../hmi/nspanel_us_land_code}/alarm.txt | 0 .../hmi/nspanel_us_land_code}/boot.txt | 556 +- .../nspanel_us_land_code}/buttonpage01.txt | 1574 +- .../nspanel_us_land_code}/buttonpage02.txt | 1574 +- .../nspanel_us_land_code}/buttonpage03.txt | 1574 +- .../nspanel_us_land_code}/buttonpage04.txt | 1574 +- .../hmi/nspanel_us_land_code}/climate.txt | 0 .../hmi/nspanel_us_land_code}/confirm.txt | 0 .../hmi/nspanel_us_land_code}/cover.txt | 486 +- .../nspanel_us_land_code}/entitypage01.txt | 790 +- .../nspanel_us_land_code}/entitypage02.txt | 790 +- .../nspanel_us_land_code}/entitypage03.txt | 790 +- .../nspanel_us_land_code}/entitypage04.txt | 790 +- .../hmi/nspanel_us_land_code}/fan.txt | 0 .../hmi/nspanel_us_land_code}/home.txt | 1248 +- .../hmi/nspanel_us_land_code}/instructions.md | 0 .../hmi/nspanel_us_land_code}/keyb_num.txt | 0 .../hmi/nspanel_us_land_code}/light.txt | 1418 +- .../nspanel_us_land_code}/media_player.txt | 0 .../nspanel_us_land_code}/notification.txt | 404 +- .../pics/30_vertical.png | Bin .../pics/31_vertical.png | Bin .../hmi/nspanel_us_land_code}/qrcode.txt | 296 +- .../hmi/nspanel_us_land_code}/screensaver.txt | 82 +- .../hmi/nspanel_us_land_code}/settings.txt | 692 +- .../hmi/nspanel_us_land_code}/weather01.txt | 584 +- .../hmi/nspanel_us_land_code}/weather02.txt | 584 +- .../hmi/nspanel_us_land_code}/weather03.txt | 584 +- .../hmi/nspanel_us_land_code}/weather04.txt | 584 +- .../hmi/nspanel_us_land_code}/weather05.txt | 584 +- .../.vscode/settings.json | 5 - .../NSPanel_HA_Blueprint-beta/README.md | 159 - .../NSPanel_HA_Blueprint-beta/blueprint.yaml | 14851 ---------------- .../custom_configuration/climate.yaml | 18 - .../custom_configuration/folder_watcher.yaml | 7 - .../custom_configuration/sensor.yaml | 78 - .../NSPanel_HA_Blueprint-beta/esphome.yaml | 1198 -- .../nspanel_buero.tft | Bin 2688576 -> 0 bytes .../NSPanel_HA_Blueprint-main/README.md | 159 - .../NSPanel_HA_Blueprint-main/blueprint.yaml | 3341 ---- .../custom_configuration/climate.yaml | 18 - .../custom_configuration/folder_watcher.yaml | 7 - .../custom_configuration/sensor.yaml | 78 - .../NSPanel_HA_Blueprint-main/esphome.yaml | 1168 -- .../nspanel_buero.tft | Bin 2223144 -> 0 bytes .../OLD NSPanel version/OLD_nspanel_blank.tft | Bin 263492 -> 0 bytes .../OLD_nspanel_blank_9600.tft | Bin 263492 -> 0 bytes .../OLD NSPanel version/nspanel_old.HMI | Bin 17409963 -> 0 bytes .../OLD NSPanel version/nspanel_old.tft | Bin 8162516 -> 0 bytes custom_configuration/climate.yaml | 18 - custom_configuration/folder_watcher.yaml | 7 - custom_configuration/sensor.yaml | 78 - .../nspanel_blank.tft => nspanel_blank.tft | Bin nspanel_esphome.yaml | 4 +- 129 files changed, 19363 insertions(+), 40553 deletions(-) rename nspanel_esphome_addon_climate_base.yaml => advanced/esphome/nspanel_esphome_addon_climate_base.yaml (100%) rename nspanel_esphome_addon_climate_cool.yaml => advanced/esphome/nspanel_esphome_addon_climate_cool.yaml (100%) rename nspanel_esphome_addon_climate_heat.yaml => advanced/esphome/nspanel_esphome_addon_climate_heat.yaml (100%) rename nspanel_esphome_addon_upload_tft.yaml => advanced/esphome/nspanel_esphome_addon_upload_tft.yaml (100%) rename nspanel_esphome_advanced.yaml => advanced/esphome/nspanel_esphome_advanced.yaml (100%) rename nspanel_esphome_core.yaml => advanced/esphome/nspanel_esphome_core.yaml (100%) rename {custom_configuration => advanced/hmi}/nspanel_blank.HMI (100%) rename {custom_configuration => advanced/hmi}/nspanel_blank_code/Program.s.txt (100%) rename {custom_configuration => advanced/hmi}/nspanel_blank_code/blank.txt (100%) rename {custom_configuration => advanced/hmi}/nspanel_blank_code/page0.txt (100%) rename {custom_configuration => advanced/hmi}/nspanel_blank_code/screensaver.txt (100%) rename nspanel_eu.HMI => advanced/hmi/nspanel_eu.HMI (100%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/Program.s.txt (98%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/alarm.txt (100%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/boot.txt (96%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/buttonpage01.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/buttonpage02.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/buttonpage03.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/buttonpage04.txt (100%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/climate.txt (100%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/confirm.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/cover.txt (96%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/entitypage01.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/entitypage02.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/entitypage03.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/entitypage04.txt (100%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/fan.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/home.txt (100%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/keyb_num.txt (100%) rename {nspanel_us_code => advanced/hmi/nspanel_eu_code}/light.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/media_player.txt (100%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/notification.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/pics/SinglePixel.png (100%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/power.page (100%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/power.txt (100%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/qrcode.txt (95%) rename {nspanel_eu_code => advanced/hmi/nspanel_eu_code}/screensaver.txt (95%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/settings.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/weather01.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/weather02.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/weather03.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/weather04.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_eu_code}/weather05.txt (100%) rename nspanel_us.HMI => advanced/hmi/nspanel_us.HMI (100%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/Program.s.txt (98%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/alarm.txt (100%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/boot.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_code}/buttonpage01.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/buttonpage02.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_code}/buttonpage03.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/buttonpage04.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/climate.txt (100%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/confirm.txt (100%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/cover.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/entitypage01.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/entitypage02.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/entitypage03.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_code}/entitypage04.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/fan.txt (100%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/home.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/keyb_num.txt (100%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_code}/light.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/media_player.txt (100%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/notification.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/nspanel_us_Stats.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_code}/qrcode.txt (95%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/screensaver.txt (95%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/settings.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/weather01.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_code}/weather02.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/weather03.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/weather04.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_code}/weather05.txt (96%) rename nspanel_us_land.HMI => advanced/hmi/nspanel_us_land.HMI (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/Program.s.txt (98%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/alarm.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/boot.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_land_code}/buttonpage01.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_land_code}/buttonpage02.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_land_code}/buttonpage03.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_land_code}/buttonpage04.txt (96%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/climate.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/confirm.txt (100%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_land_code}/cover.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_land_code}/entitypage01.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_land_code}/entitypage02.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_land_code}/entitypage03.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_land_code}/entitypage04.txt (96%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/fan.txt (100%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_land_code}/home.txt (96%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/instructions.md (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/keyb_num.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/light.txt (96%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/media_player.txt (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/notification.txt (96%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/pics/30_vertical.png (100%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/pics/31_vertical.png (100%) rename {nspanel_us_code => advanced/hmi/nspanel_us_land_code}/qrcode.txt (95%) rename {nspanel_us_land_code => advanced/hmi/nspanel_us_land_code}/screensaver.txt (95%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_land_code}/settings.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_land_code}/weather01.txt (96%) rename {nspanel_us_code => advanced/hmi/nspanel_us_land_code}/weather02.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_land_code}/weather03.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_land_code}/weather04.txt (96%) rename {nspanel_eu_code => advanced/hmi/nspanel_us_land_code}/weather05.txt (96%) delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-beta/.vscode/settings.json delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-beta/README.md delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-beta/blueprint.yaml delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-beta/custom_configuration/climate.yaml delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-beta/custom_configuration/folder_watcher.yaml delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-beta/custom_configuration/sensor.yaml delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-beta/esphome.yaml delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-beta/nspanel_buero.tft delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-main/README.md delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-main/blueprint.yaml delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-main/custom_configuration/climate.yaml delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-main/custom_configuration/folder_watcher.yaml delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-main/custom_configuration/sensor.yaml delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-main/esphome.yaml delete mode 100644 custom_configuration/OLD NSPanel version/NSPanel_HA_Blueprint-main/nspanel_buero.tft delete mode 100644 custom_configuration/OLD NSPanel version/OLD_nspanel_blank.tft delete mode 100644 custom_configuration/OLD NSPanel version/OLD_nspanel_blank_9600.tft delete mode 100644 custom_configuration/OLD NSPanel version/nspanel_old.HMI delete mode 100644 custom_configuration/OLD NSPanel version/nspanel_old.tft delete mode 100644 custom_configuration/climate.yaml delete mode 100644 custom_configuration/folder_watcher.yaml delete mode 100644 custom_configuration/sensor.yaml rename custom_configuration/nspanel_blank.tft => nspanel_blank.tft (100%) diff --git a/nspanel_esphome_addon_climate_base.yaml b/advanced/esphome/nspanel_esphome_addon_climate_base.yaml similarity index 100% rename from nspanel_esphome_addon_climate_base.yaml rename to advanced/esphome/nspanel_esphome_addon_climate_base.yaml diff --git a/nspanel_esphome_addon_climate_cool.yaml b/advanced/esphome/nspanel_esphome_addon_climate_cool.yaml similarity index 100% rename from nspanel_esphome_addon_climate_cool.yaml rename to advanced/esphome/nspanel_esphome_addon_climate_cool.yaml diff --git a/nspanel_esphome_addon_climate_heat.yaml b/advanced/esphome/nspanel_esphome_addon_climate_heat.yaml similarity index 100% rename from nspanel_esphome_addon_climate_heat.yaml rename to advanced/esphome/nspanel_esphome_addon_climate_heat.yaml diff --git a/nspanel_esphome_addon_upload_tft.yaml b/advanced/esphome/nspanel_esphome_addon_upload_tft.yaml similarity index 100% rename from nspanel_esphome_addon_upload_tft.yaml rename to advanced/esphome/nspanel_esphome_addon_upload_tft.yaml diff --git a/nspanel_esphome_advanced.yaml b/advanced/esphome/nspanel_esphome_advanced.yaml similarity index 100% rename from nspanel_esphome_advanced.yaml rename to advanced/esphome/nspanel_esphome_advanced.yaml diff --git a/nspanel_esphome_core.yaml b/advanced/esphome/nspanel_esphome_core.yaml similarity index 100% rename from nspanel_esphome_core.yaml rename to advanced/esphome/nspanel_esphome_core.yaml diff --git a/custom_configuration/nspanel_blank.HMI b/advanced/hmi/nspanel_blank.HMI similarity index 100% rename from custom_configuration/nspanel_blank.HMI rename to advanced/hmi/nspanel_blank.HMI diff --git a/custom_configuration/nspanel_blank_code/Program.s.txt b/advanced/hmi/nspanel_blank_code/Program.s.txt similarity index 100% rename from custom_configuration/nspanel_blank_code/Program.s.txt rename to advanced/hmi/nspanel_blank_code/Program.s.txt diff --git a/custom_configuration/nspanel_blank_code/blank.txt b/advanced/hmi/nspanel_blank_code/blank.txt similarity index 100% rename from custom_configuration/nspanel_blank_code/blank.txt rename to advanced/hmi/nspanel_blank_code/blank.txt diff --git a/custom_configuration/nspanel_blank_code/page0.txt b/advanced/hmi/nspanel_blank_code/page0.txt similarity index 100% rename from custom_configuration/nspanel_blank_code/page0.txt rename to advanced/hmi/nspanel_blank_code/page0.txt diff --git a/custom_configuration/nspanel_blank_code/screensaver.txt b/advanced/hmi/nspanel_blank_code/screensaver.txt similarity index 100% rename from custom_configuration/nspanel_blank_code/screensaver.txt rename to advanced/hmi/nspanel_blank_code/screensaver.txt diff --git a/nspanel_eu.HMI b/advanced/hmi/nspanel_eu.HMI similarity index 100% rename from nspanel_eu.HMI rename to advanced/hmi/nspanel_eu.HMI diff --git a/nspanel_eu_code/Program.s.txt b/advanced/hmi/nspanel_eu_code/Program.s.txt similarity index 98% rename from nspanel_eu_code/Program.s.txt rename to advanced/hmi/nspanel_eu_code/Program.s.txt index 81c87af..00cf31b 100644 --- a/nspanel_eu_code/Program.s.txt +++ b/advanced/hmi/nspanel_eu_code/Program.s.txt @@ -1,26 +1,26 @@ -Program.s - //The following code is only run once when power on, and is generally used for global variable definition and power on initialization data - int sys0=0,sys1=0,sys2=0,swipex=0,swipey=0,swipex2=0,swipey2=0,swipec=0,swipec2=0,swipedx=100,swipedy=100 //At present, the definition of global variable only supports 4-byte signed integer (int), and other types of global quantity declaration are not supported. If you want to use string type, you can use variable control in the page to implement - int r=0,g=0,b=0 - int h=0,s=0,v=0 - int p=0,q=0,t=0,f=0 - int dimdelta=0 - int api=0 // 0 = disconnected from HA, 1 = connected to HA - int is_alarm=0,is_entities=0,is_qrcode=0,is_notification=0 - int brightness=100,brightness_dim=40 - int display_mode=1 // 1 = EU, 2 = US, 3 = US landscape - //bauds=115200//Configure baudrate - recmod=0//Serial data parsing mode:0-Passive mode;1-Active mode - randset 0,65535//used for touchevent sensor - printh 00 00 00 ff ff ff 88 ff ff ff//Output power on information to serial port - if(display_mode==1) - { - lcd_dev fffb 0002 0000 0020// Fix touch offset for EU Version - } - printh 92 - prints "currentpage",0 - printh 00 - prints "",0 - printh 00 - printh FF FF FF - page 8//Power on start page boot +Program.s + //The following code is only run once when power on, and is generally used for global variable definition and power on initialization data + int sys0=0,sys1=0,sys2=0,swipex=0,swipey=0,swipex2=0,swipey2=0,swipec=0,swipec2=0,swipedx=100,swipedy=100 //At present, the definition of global variable only supports 4-byte signed integer (int), and other types of global quantity declaration are not supported. If you want to use string type, you can use variable control in the page to implement + int r=0,g=0,b=0 + int h=0,s=0,v=0 + int p=0,q=0,t=0,f=0 + int dimdelta=0 + int api=0 // 0 = disconnected from HA, 1 = connected to HA + int is_alarm=0,is_entities=0,is_qrcode=0,is_notification=0 + int brightness=100,brightness_dim=40 + int display_mode=1 // 1 = EU, 2 = US, 3 = US landscape + //bauds=115200//Configure baudrate + recmod=0//Serial data parsing mode:0-Passive mode;1-Active mode + randset 0,65535//used for touchevent sensor + printh 00 00 00 ff ff ff 88 ff ff ff//Output power on information to serial port + if(display_mode==1) + { + lcd_dev fffb 0002 0000 0020// Fix touch offset for EU Version + } + printh 92 + prints "currentpage",0 + printh 00 + prints "",0 + printh 00 + printh FF FF FF + page 8//Power on start page boot diff --git a/nspanel_eu_code/alarm.txt b/advanced/hmi/nspanel_eu_code/alarm.txt similarity index 100% rename from nspanel_eu_code/alarm.txt rename to advanced/hmi/nspanel_eu_code/alarm.txt diff --git a/nspanel_eu_code/boot.txt b/advanced/hmi/nspanel_eu_code/boot.txt similarity index 96% rename from nspanel_eu_code/boot.txt rename to advanced/hmi/nspanel_eu_code/boot.txt index 9f168f3..59c4df2 100644 --- a/nspanel_eu_code/boot.txt +++ b/advanced/hmi/nspanel_eu_code/boot.txt @@ -1,278 +1,278 @@ -Page boot - Attributes - ID : 0 - Scope : local - Dragging : 0 - Send Component ID : disabled - Locked : no - Swide up page ID : disabled - Swide down page ID : disabled - Swide left page ID : disabled - Swide right page ID: disabled - - Events - Preinitialize Event - printh 92 - prints "currentpage",0 - printh 00 - prints "boot",0 - printh 00 - printh FF FF FF - dim=0 - vis bt_reboot,0 - covx baud,baud_rate.txt,0,0 - baud_rate.txt+=" bps" - covx display_mode,aux2.txt,0,0 - nspanelevent.txt="{\"page\": \"boot\", \"event\": \"pagechanged\", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}" - printh 92 - prints "localevent",0 - printh 00 - prints nspanelevent.txt,0 - printh 00 - printh FF FF FF - - Touch Press Event - printh 91 - prints "touchevent",0 - printh 00 - prints rand,0 - printh FF FF FF - - Touch Release Event - printh 91 - prints "touchevent",0 - printh 00 - prints rand,0 - printh FF FF FF - - Page Exit Event - dim=0 - -Variable (int32) counter - Attributes - ID : 12 - Scope: local - Value: 0 - -Variable (string) aux1 - Attributes - ID : 13 - Scope : local - Text : - Max. Text Size: 10 - -Variable (string) nspanelevent - Attributes - ID : 14 - Scope : local - Text : - Max. Text Size: 150 - -Variable (string) aux2 - Attributes - ID : 15 - Scope : local - Text : - Max. Text Size: 10 - -Text ip_addr - Attributes - ID : 1 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : Initializing... - Max. Text Size : 15 - -Text t0 - Attributes - ID : 2 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : Please wait... - Max. Text Size : 15 - -Text t1 - Attributes - ID : 3 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : The process can take several seconds! - Max. Text Size : 50 - -Text tft_label - Attributes - ID : 5 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : TFT: - Max. Text Size : 4 - -Text esph_label - Attributes - ID : 6 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : ESPHome: - Max. Text Size : 8 - -Text bluep_label - Attributes - ID : 7 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : Blueprint: - Max. Text Size : 10 - -Text tft_version - Attributes - ID : 8 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : 4.1.4 - Max. Text Size : 9 - -Text esph_version - Attributes - ID : 9 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : - Max. Text Size : 9 - -Text bluep_version - Attributes - ID : 10 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : - Max. Text Size : 9 - -Text baud_rate - Attributes - ID : 18 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : - Max. Text Size : 10 - -Text framework - Attributes - ID : 20 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : - Max. Text Size : 10 - -Dual-state Button bt_reboot - Attributes - ID : 4 - Scope : local - Dragging : 0 - Send Component ID: on press and release - State : unpressed - Text : Reboot - Max. Text Size : 6 - -Timer timer - Attributes - ID : 11 - Scope : local - Period (ms): 65534 - Enabled : yes - - Events - Timer Event - counter.val++ - covx counter.val,aux1.txt,0,0 - covx display_mode,aux2.txt,0,0 - nspanelevent.txt="{\"page\": \"boot\", \"event\": \"timeout\", \"value\": "+aux1.txt+", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}" - bluep_version.txt="Retry: "+aux1.txt - printh 92 - prints "nspanelevent",0 - printh 00 - prints nspanelevent.txt,0 - printh 00 - printh FF FF FF - -Timer wakeup_timer - Attributes - ID : 16 - Scope : local - Period (ms): 50 - Enabled : yes - - Events - Timer Event - if(dim<100) - { - dimdelta=100-dim - dimdelta/=25 - if(dimdelta<1) - { - dimdelta=1 - } - dim+=dimdelta - }else - { - wakeup_timer.en=0 - } - -Timer tm_esphome - Attributes - ID : 17 - Scope : local - Period (ms): 30000 - Enabled : yes - - Events - Timer Event - if(baud==115200) - { - bauds=921600 - }else - { - bauds=115200 - } - covx baud,baud_rate.txt,0,0 - baud_rate.txt+=" bps" - -Timer tm_pageid - Attributes - ID : 19 - Scope : local - Period (ms): 2500 - Enabled : yes - - Events - Timer Event - covx display_mode,aux2.txt,0,0 - nspanelevent.txt="{\"page\": \"boot\", \"event\": \"pagechanged\", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}" - printh 92 - prints "localevent",0 - printh 00 - prints nspanelevent.txt,0 - printh 00 - printh FF FF FF - +Page boot + Attributes + ID : 0 + Scope : local + Dragging : 0 + Send Component ID : disabled + Locked : no + Swide up page ID : disabled + Swide down page ID : disabled + Swide left page ID : disabled + Swide right page ID: disabled + + Events + Preinitialize Event + printh 92 + prints "currentpage",0 + printh 00 + prints "boot",0 + printh 00 + printh FF FF FF + dim=0 + vis bt_reboot,0 + covx baud,baud_rate.txt,0,0 + baud_rate.txt+=" bps" + covx display_mode,aux2.txt,0,0 + nspanelevent.txt="{\"page\": \"boot\", \"event\": \"pagechanged\", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints nspanelevent.txt,0 + printh 00 + printh FF FF FF + + Touch Press Event + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + + Touch Release Event + printh 91 + prints "touchevent",0 + printh 00 + prints rand,0 + printh FF FF FF + + Page Exit Event + dim=0 + +Variable (int32) counter + Attributes + ID : 12 + Scope: local + Value: 0 + +Variable (string) aux1 + Attributes + ID : 13 + Scope : local + Text : + Max. Text Size: 10 + +Variable (string) nspanelevent + Attributes + ID : 14 + Scope : local + Text : + Max. Text Size: 150 + +Variable (string) aux2 + Attributes + ID : 15 + Scope : local + Text : + Max. Text Size: 10 + +Text ip_addr + Attributes + ID : 1 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : Initializing... + Max. Text Size : 15 + +Text t0 + Attributes + ID : 2 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : Please wait... + Max. Text Size : 15 + +Text t1 + Attributes + ID : 3 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : The process can take several seconds! + Max. Text Size : 50 + +Text tft_label + Attributes + ID : 5 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : TFT: + Max. Text Size : 4 + +Text esph_label + Attributes + ID : 6 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : ESPHome: + Max. Text Size : 8 + +Text bluep_label + Attributes + ID : 7 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : Blueprint: + Max. Text Size : 10 + +Text tft_version + Attributes + ID : 8 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : 4.1.4 + Max. Text Size : 9 + +Text esph_version + Attributes + ID : 9 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 9 + +Text bluep_version + Attributes + ID : 10 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 9 + +Text baud_rate + Attributes + ID : 18 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 10 + +Text framework + Attributes + ID : 20 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 10 + +Dual-state Button bt_reboot + Attributes + ID : 4 + Scope : local + Dragging : 0 + Send Component ID: on press and release + State : unpressed + Text : Reboot + Max. Text Size : 6 + +Timer timer + Attributes + ID : 11 + Scope : local + Period (ms): 65534 + Enabled : yes + + Events + Timer Event + counter.val++ + covx counter.val,aux1.txt,0,0 + covx display_mode,aux2.txt,0,0 + nspanelevent.txt="{\"page\": \"boot\", \"event\": \"timeout\", \"value\": "+aux1.txt+", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}" + bluep_version.txt="Retry: "+aux1.txt + printh 92 + prints "nspanelevent",0 + printh 00 + prints nspanelevent.txt,0 + printh 00 + printh FF FF FF + +Timer wakeup_timer + Attributes + ID : 16 + Scope : local + Period (ms): 50 + Enabled : yes + + Events + Timer Event + if(dim<100) + { + dimdelta=100-dim + dimdelta/=25 + if(dimdelta<1) + { + dimdelta=1 + } + dim+=dimdelta + }else + { + wakeup_timer.en=0 + } + +Timer tm_esphome + Attributes + ID : 17 + Scope : local + Period (ms): 30000 + Enabled : yes + + Events + Timer Event + if(baud==115200) + { + bauds=921600 + }else + { + bauds=115200 + } + covx baud,baud_rate.txt,0,0 + baud_rate.txt+=" bps" + +Timer tm_pageid + Attributes + ID : 19 + Scope : local + Period (ms): 2500 + Enabled : yes + + Events + Timer Event + covx display_mode,aux2.txt,0,0 + nspanelevent.txt="{\"page\": \"boot\", \"event\": \"pagechanged\", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints nspanelevent.txt,0 + printh 00 + printh FF FF FF + diff --git a/nspanel_us_land_code/buttonpage01.txt b/advanced/hmi/nspanel_eu_code/buttonpage01.txt similarity index 100% rename from nspanel_us_land_code/buttonpage01.txt rename to advanced/hmi/nspanel_eu_code/buttonpage01.txt diff --git a/nspanel_us_land_code/buttonpage02.txt b/advanced/hmi/nspanel_eu_code/buttonpage02.txt similarity index 100% rename from nspanel_us_land_code/buttonpage02.txt rename to advanced/hmi/nspanel_eu_code/buttonpage02.txt diff --git a/nspanel_us_land_code/buttonpage03.txt b/advanced/hmi/nspanel_eu_code/buttonpage03.txt similarity index 100% rename from nspanel_us_land_code/buttonpage03.txt rename to advanced/hmi/nspanel_eu_code/buttonpage03.txt diff --git a/nspanel_us_land_code/buttonpage04.txt b/advanced/hmi/nspanel_eu_code/buttonpage04.txt similarity index 100% rename from nspanel_us_land_code/buttonpage04.txt rename to advanced/hmi/nspanel_eu_code/buttonpage04.txt diff --git a/nspanel_eu_code/climate.txt b/advanced/hmi/nspanel_eu_code/climate.txt similarity index 100% rename from nspanel_eu_code/climate.txt rename to advanced/hmi/nspanel_eu_code/climate.txt diff --git a/nspanel_eu_code/confirm.txt b/advanced/hmi/nspanel_eu_code/confirm.txt similarity index 100% rename from nspanel_eu_code/confirm.txt rename to advanced/hmi/nspanel_eu_code/confirm.txt diff --git a/nspanel_us_land_code/cover.txt b/advanced/hmi/nspanel_eu_code/cover.txt similarity index 96% rename from nspanel_us_land_code/cover.txt rename to advanced/hmi/nspanel_eu_code/cover.txt index de7bbf2..1b18b80 100644 --- a/nspanel_us_land_code/cover.txt +++ b/advanced/hmi/nspanel_eu_code/cover.txt @@ -1,243 +1,243 @@ -Page cover - Attributes - ID : 0 - Scope : local - Dragging : 0 - Send Component ID : disabled - Locked : no - Swide up page ID : disabled - Swide down page ID : disabled - Swide left page ID : disabled - Swide right page ID: disabled - - Events - Preinitialize Event - if(api==0) - { - page home - }else - { - printh 92 - prints "currentpage",0 - printh 00 - prints "cover",0 - printh 00 - printh FF FF FF - } - - Touch Press Event - printh 91 - prints "touchevent",0 - printh 00 - prints rand,0 - printh FF FF FF - - Touch Release Event - printh 91 - prints "touchevent",0 - printh 00 - prints rand,0 - printh FF FF FF - -Variable (string) va1 - Attributes - ID : 7 - Scope : local - Text : newtxt - Max. Text Size: 10 - -Variable (string) coversetting - Attributes - ID : 11 - Scope : local - Text : - Max. Text Size: 255 - -Variable (string) back_page - Attributes - ID : 12 - Scope : local - Text : home - Max. Text Size: 15 - -Text battery_value - Attributes - ID : 1 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : - Max. Text Size : 10 - -Text cover_value - Attributes - ID : 2 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : - Max. Text Size : 10 - -Text page_label - Attributes - ID : 3 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : - Max. Text Size : 25 - -Text icon_state - Attributes - ID : 9 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : - Max. Text Size : 10 - -Text battery_icon - Attributes - ID : 10 - Scope : local - Dragging : 0 - Send Component ID : disabled - Associated Keyboard: none - Text : - Max. Text Size : 10 - -Slider coverslider - Attributes - ID : 6 - Scope : local - Dragging : 0 - Send Component ID: disabled - Position : 0 - Upper range limit: 100 - Lower range limit: 0 - - Events - Touch Release Event - covx coverslider.val,va1.txt,0,0 - cover_value.txt=va1.txt+"%" - coversetting.txt="{\"page\": \"cover\", \"key\": \"position\", \"value\": "+va1.txt+"}" - printh 92 - prints "localevent",0 - printh 00 - prints coversetting.txt,0 - printh 00 - printh FF FF FF - -Button cover_open - Attributes - ID : 4 - Scope : local - Dragging : 0 - Send Component ID: disabled - State : unpressed - Text : - Max. Text Size : 3 - - Events - Touch Press Event - printh 92 - prints "localevent",0 - printh 00 - prints "{\"page\": \"cover\", \"key\": \"open_cover\", \"value\": \"press\"}",0 - printh 00 - printh FF FF FF - -Button cover_close - Attributes - ID : 5 - Scope : local - Dragging : 0 - Send Component ID: disabled - State : unpressed - Text : - Max. Text Size : 3 - - Events - Touch Press Event - printh 92 - prints "localevent",0 - printh 00 - prints "{\"page\": \"cover\", \"key\": \"close_cover\", \"value\": \"press\"}",0 - printh 00 - printh FF FF FF - -Button cover_stop - Attributes - ID : 8 - Scope : local - Dragging : 0 - Send Component ID: disabled - State : unpressed - Text : - Max. Text Size : 3 - - Events - Touch Press Event - printh 92 - prints "localevent",0 - printh 00 - prints "{\"page\": \"cover\", \"key\": \"stop_cover\", \"value\": \"press\"}",0 - printh 00 - printh FF FF FF - -Button button_back - Attributes - ID : 13 - Scope : local - Dragging : 0 - Send Component ID: disabled - State : unpressed - Text :  - Max. Text Size : 3 - - Events - Touch Press Event - if(back_page.txt=="buttonpage01") - { - page buttonpage01 - }else if(back_page.txt=="buttonpage02") - { - page buttonpage02 - }else if(back_page.txt=="buttonpage03") - { - page buttonpage03 - }else if(back_page.txt=="buttonpage04") - { - page buttonpage04 - }else - { - page home - } - -Timer wakeup_timer - Attributes - ID : 14 - Scope : local - Period (ms): 100 - Enabled : yes - - Events - Timer Event - if(dim