Skip to content

Commit 5a768f7

Browse files
committed
Nitpick suggestiong from @coderabbitai
#1 (review)
1 parent dda4be8 commit 5a768f7

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

esphome/nspanel_esphome_core.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ number:
8989
- script.execute: timer_dim
9090

9191
script: # Scripts
92+
- id: !extend action_component_text
93+
then:
94+
- lambda: |-
95+
if (page == "mem" && component == "decimal_separator" && !txt.empty())
96+
id(mui_decimal_separator) = txt[0];
97+
9298
- id: !extend dump_config
9399
then:
94100
- lambda: |-

esphome/nspanel_esphome_hw_relays.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ script:
5656
then:
5757
- lambda: |-
5858
if (page == "mem") {
59-
if (component == "decimal_separator") {
60-
if (!txt.empty()) id(mui_decimal_separator) = txt[0];
61-
} else if (component == "relay1_icon") {
59+
if (component == "relay1_icon") {
6260
id(home_relay1_icon) = txt;
6361
disp1->set_component_text(hmi::home::CHIP_RELAY1.name, id(home_relay1_icon).c_str());
6462
} else if (component == "relay2_icon") {

esphome/nspanel_esphome_page_entities.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ script:
8181
- id: !extend action_component_val
8282
then:
8383
- lambda: |-
84-
if (page == "mem" and component == "ent_value_xcen") { // Entities pages alignment
84+
if (page == "mem" and component == "ent_value_xcen") { // Entities pages alignment (0=Left, 1=Center, 2=Right)
85+
if (val > 2) {
86+
ESP_LOGW("${TAG_PAGE_ENTITIES}", "Invalid alignment value: %i (expected 0-2)", val);
87+
return;
88+
}
8589
ESP_LOGD("${TAG_PAGE_ENTITIES}", "Set value alignment on entities pages: %i", val);
8690
page_entities_value_horizontal_alignment = val;
8791
}

0 commit comments

Comments
 (0)