Skip to content

Commit aa0ebb6

Browse files
authored
Merge pull request #58 from edwardtfn/v9999.99.9
Move localization to ESPHome compile-time substitutions
2 parents dc6c18f + e9e5292 commit aa0ebb6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+597
-3046
lines changed

docs/addon_climate.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ substitutions:
3434
wifi_ssid: !secret wifi_ssid
3535
wifi_password: !secret wifi_password
3636
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
37+
language: en # Language code - see docs/localization.md for all supported codes
3738

3839
# Add-on configuration (if needed)
3940
## Upload TFT
@@ -68,23 +69,23 @@ packages:
6869
The following keys are available to be used in your `substitutions`:
6970

7071
<!-- markdownlint-disable MD013 MD033 -->
71-
Key|Required|Supported values|Default|Description
72-
:-|:-:|:-:|:-:|:-
73-
cooler_relay|Mandatory for *cool* and *dual*|`1` or `2`|`0` (disabled)|Relay used to control the cooler. Use `1` for "Relay 1" or `2` for "Relay 2".
74-
heater_relay|Mandatory for *heat* and *dual*|`1` or `2`|`0` (disabled)|Relay used to control the heater. Use `1` for "Relay 1" or `2` for "Relay 2".
75-
temp_units|Optional|`°C` or `°F`|`°C`|Temperature unit.
76-
min_off_time|Optional|Positive integer representing the number of seconds|`300`|Minimum duration (in seconds) the cooling/heating action must be disengaged before it may be engaged.
77-
min_run_time|Optional|Positive integer representing the number of seconds|`300`|Minimum duration (in seconds) the cooling/heating action must be engaged before it may be disengaged.
78-
min_idle_time|Optional|Positive integer representing the number of seconds|`30`|Minimum duration (in seconds) the idle action must be active before calling another climate action.
79-
target_low|Optional|Number representing a temperature in the selected unit|`18` (°C) or `64` (°F)|The initial lower threshold for the target temperature.
80-
target_high|Optional|Number representing a temperature in the selected unit|`24` (°C) or `75` (°F)|The initial higher threshold for the target temperature.
81-
temp_min|Optional|Number representing a temperature in the selected unit|*cool: `15` (°C) or `60` (°F)*<br>*heat: `7` (°C) or `45` (°F)*<br>*dual: `7` (°C) or `45` (°F)* |The minimum temperature the climate device can reach. Used to set the range of the frontend gauge.
82-
temp_max|Optional|Number representing a temperature in the selected unit|*cool: `45` (°C) or `113` (°F)*<br>*heat: `35` (°C) or `95` (°F)*<br>*dual: `45` (°C) or `113` (°F)* |The maximum temperature the climate device can reach. Used to set the range of the frontend gauge.
83-
~temp_step~|Deprecated|~Number representing a temperature in the selected unit~|~`0.5`~<br>`0.5` (°C) or `1` (°F)|~The granularity with which the target temperature can be controlled.~
84-
cool_deadband|Optional|Number representing a temperature hysteresis in the selected unit|`0.5` (°C) or `1` (°F)|The minimum temperature differential (temperature above the set point) before engaging cooling.
85-
cool_overrun|Optional|Number representing a temperature hysteresis in the selected unit|`0.5` (°C) or `1` (°F)|The minimum temperature differential (cooling beyond the set point) before disengaging cooling.
86-
heat_deadband|Optional|Number representing a temperature hysteresis in the selected unit|`0.5` (°C) or `1` (°F)|The minimum temperature differential (temperature below the set point) before engaging heat.
87-
heat_overrun|Optional|Number representing a temperature hysteresis in the selected unit|`0.5` (°C) or `1` (°F)|The minimum temperature differential (heating beyond the set point) before disengaging heat.
72+
| Key | Required | Supported values | Default | Description |
73+
| :- | :-: | :-: | :-: | :- |
74+
| cooler_relay | Mandatory for *cool* and *dual* | `1` or `2` | `0` (disabled) | Relay used to control the cooler. Use `1` for "Relay 1" or `2` for "Relay 2". |
75+
| heater_relay | Mandatory for *heat* and *dual* | `1` or `2` | `0` (disabled) | Relay used to control the heater. Use `1` for "Relay 1" or `2` for "Relay 2". |
76+
| temp_units | Optional | `°C` or `°F` | `°C` | Temperature unit. |
77+
| min_off_time | Optional | Positive integer representing the number of seconds | `300` | Minimum duration (in seconds) the cooling/heating action must be disengaged before it may be engaged. |
78+
| min_run_time | Optional | Positive integer representing the number of seconds | `300` | Minimum duration (in seconds) the cooling/heating action must be engaged before it may be disengaged. |
79+
| min_idle_time | Optional | Positive integer representing the number of seconds | `30` | Minimum duration (in seconds) the idle action must be active before calling another climate action. |
80+
| target_low | Optional | Number representing a temperature in the selected unit | `18` (°C) or `64` (°F) | The initial lower threshold for the target temperature. |
81+
| target_high | Optional | Number representing a temperature in the selected unit | `24` (°C) or `75` (°F) | The initial higher threshold for the target temperature. |
82+
| temp_min | Optional | Number representing a temperature in the selected unit | *cool: `15` (°C) or `60` (°F)*<br>*heat: `7` (°C) or `45` (°F)*<br>*dual: `7` (°C) or `45` (°F)* | The minimum temperature the climate device can reach. Used to set the range of the frontend gauge. |
83+
| temp_max | Optional | Number representing a temperature in the selected unit | *cool: `45` (°C) or `113` (°F)*<br>*heat: `35` (°C) or `95` (°F)*<br>*dual: `45` (°C) or `113` (°F)* | The maximum temperature the climate device can reach. Used to set the range of the frontend gauge. |
84+
| ~temp_step~ | Deprecated | ~Number representing a temperature in the selected unit~ | ~`0.5`~<br>`0.5` (°C) or `1` (°F) | ~The granularity with which the target temperature can be controlled.~ |
85+
| cool_deadband | Optional | Number representing a temperature hysteresis in the selected unit | `0.5` (°C) or `1` (°F) | The minimum temperature differential (temperature above the set point) before engaging cooling. |
86+
| cool_overrun | Optional | Number representing a temperature hysteresis in the selected unit | `0.5` (°C) or `1` (°F) | The minimum temperature differential (cooling beyond the set point) before disengaging cooling. |
87+
| heat_deadband | Optional | Number representing a temperature hysteresis in the selected unit | `0.5` (°C) or `1` (°F) | The minimum temperature differential (temperature below the set point) before engaging heat. |
88+
| heat_overrun | Optional | Number representing a temperature hysteresis in the selected unit | `0.5` (°C) or `1` (°F) | The minimum temperature differential (heating beyond the set point) before disengaging heat. |
8889

8990
<!-- markdownlint-enable MD013 MD033 -->
9091

@@ -104,6 +105,7 @@ substitutions:
104105
wifi_ssid: !secret wifi_ssid
105106
wifi_password: !secret wifi_password
106107
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
108+
language: en # Language code - see docs/localization.md for all supported codes
107109

108110
# Add-on configuration (if needed)
109111
## Upload TFT
@@ -146,6 +148,7 @@ substitutions:
146148
wifi_ssid: !secret wifi_ssid
147149
wifi_password: !secret wifi_password
148150
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
151+
language: en # Language code - see docs/localization.md for all supported codes
149152

150153
# Add-on configuration (if needed)
151154
## Upload TFT
@@ -188,6 +191,7 @@ substitutions:
188191
wifi_ssid: !secret wifi_ssid
189192
wifi_password: !secret wifi_password
190193
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
194+
language: en # Language code - see docs/localization.md for all supported codes
191195

192196
# Add-on configuration (if needed)
193197
## Upload TFT

docs/addon_upload_tft.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ substitutions:
4646
wifi_ssid: !secret wifi_ssid
4747
wifi_password: !secret wifi_password
4848
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
49+
language: en # Language code - see docs/localization.md for all supported codes
4950

5051
# Add-on configuration (if needed)
5152
## Upload TFT
@@ -108,6 +109,7 @@ substitutions:
108109
wifi_ssid: !secret wifi_ssid
109110
wifi_password: !secret wifi_password
110111
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
112+
language: en # Language code - see docs/localization.md for all supported codes
111113
112114
# Upload TFT configuration
113115
upload_tft_automatically: true
@@ -131,6 +133,7 @@ substitutions:
131133
wifi_ssid: !secret wifi_ssid
132134
wifi_password: !secret wifi_password
133135
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
136+
language: en # Language code - see docs/localization.md for all supported codes
134137
135138
# Disable automatic TFT upload
136139
upload_tft_automatically: false
@@ -153,6 +156,7 @@ substitutions:
153156
wifi_ssid: !secret wifi_ssid
154157
wifi_password: !secret wifi_password
155158
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
159+
language: en # Language code - see docs/localization.md for all supported codes
156160
157161
# Use a locally hosted TFT file
158162
nextion_update_url: "http://homeassistant.local:8123/local/nspanel_eu.tft"

docs/api.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ You can look up the action names available on your Home Assistant instance under
6060
### Table of Contents
6161
<!-- markdownlint-disable MD013 -->
6262
| Action ID | Action Name | Description |
63-
|------------|--------------|-------------|
63+
| --------- | ----------- | ----------- |
6464
| [`button`](#button-action-button) | [Button Action](#button-action-button) | Configures properties and state of buttons on a specified button page. |
6565
| [`command`](#command-action-command) | [Command Action](#command-action-command) | Sends a custom command directly to the display. |
6666
| [`component_color`](#component-color-action-component_color) | [Component Color Action](#component-color-action-component_color) | Changes the foreground color of a specified component on the display. |
@@ -503,7 +503,6 @@ The bitmask values are aligned with the
503503
- `code_format` (string): Specifies the code format required for arming/disarming the alarm system, such as numeric or alphanumeric.
504504
- `code_arm_required` (bool): Indicates whether a code is required to arm the system.
505505
- `entity` (string): The entity ID of the alarm system, used for state updates and control actions.
506-
- `mui_alarm` (string[]): An array of localized text strings for the alarm control buttons, supporting various alarm states and actions.
507506

508507
**Home Assistant Example:**
509508

@@ -516,13 +515,6 @@ data:
516515
code_format: "number"
517516
code_arm_required: true
518517
entity: "alarm_control_panel.home_alarm"
519-
mui_alarm:
520-
- "Zuhause"
521-
- "Abwesend"
522-
- "Nacht"
523-
- "Urlaub"
524-
- "Umgehen"
525-
- "Entwaffnen"
526518
```
527519

528520
> [!NOTE]
@@ -729,7 +721,7 @@ RTTTL is a compact format for storing melody sequences in a text-based format, m
729721
This string must conform to the RTTTL format, which includes the melody's name, default settings, and a sequence of notes.
730722

731723
**Example Tones:**
732-
For example tones and further inspiration, you can visit examples of RTTTL songs [here](https://esphome.io/components/rtttl/#common-beeps).
724+
For example tones and further inspiration, you can visit this list with [examples of RTTTL songs](https://esphome.io/components/rtttl/#common-beeps).
733725

734726
**Home Assistant Example:**
735727

docs/blueprint.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ The individual elements of the Blueprint are described below.
99

1010
It is possible to change both the color of the labels and the icons for most of the elements on each screen.
1111

12-
On the blueprint settings, you will be able to select any of the MDI icons supported by Home Assistant, however, your panel will only support the icons available on the [HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html).
12+
On the blueprint settings, you will be able to select any of the MDI icons supported by Home Assistant,
13+
however, your panel will only support the icons available on the
14+
[HASwitchPlate Material Design Icons](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html).
1315

1416
For an easier overview, the menu items "Icon Color" and "Label Color" will not be described separately in the following documentation.
1517

@@ -26,10 +28,18 @@ This is technically the only required field, as basic functionality will be avai
2628
2729
### Language for NSPanel
2830

29-
The language can be selected via the drop-down menu.
31+
Language is no longer configured in the Blueprint. It is now set directly in your ESPHome YAML
32+
as a substitution, which means only your chosen language's strings are compiled into the firmware —
33+
saving memory and allowing the panel to display correct date and UI strings even when offline.
3034

31-
Currently around 30 languages are supported, but if you cannot find your language there,
32-
please create a [new feature request](https://github.com/edwardtfn/NSPanel-Easy/issues/new) and we will be happy to help.
35+
To set your language, add the `language` substitution to your ESPHome YAML:
36+
37+
```yaml
38+
substitutions:
39+
language: pt # Portuguese - see docs/localization.md for all supported codes
40+
```
41+
42+
For the full list of supported language codes, see [Localization](localization.md).
3343
3444
### Date format
3545
@@ -63,7 +73,7 @@ If the value of the sensor needs to be corrected, this can be done via the tempe
6373
## Home page - Entities States
6474
6575
| Entity | Description | Example |
66-
| --- | --- | --- |
76+
| --- | --- | --- |
6777
| Home page - Entity State 01-04 (Optional) | Up to four HA entities can be displayed on the home screen. | ![home_page_entity_state_01_04.jpg](pics/home_page_entity_state_01_04.jpg) |
6878
| Home page - Chips 01-07 (optional) | Used to display icons of HA binary entities on the home screen. The icon is displayed when the entity is on/open/true/active. Otherwise, no icon is displayed. | ![chip](pics/home_page_chips.jpg) |
6979
| Custom button 01-06 (Optional) | 7 custom buttons that can be assigned to different entities from your Home Assistant. The behavior of these buttons will depend on the entity's domain, such as light, media player, etc. | ![home_page_custom_buttons.jpg](pics/home_page_custom_buttons.jpg) |

docs/customization.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ substitutions:
7575
wifi_ssid: !secret wifi_ssid
7676
wifi_password: !secret wifi_password
7777
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
78+
language: en # Language code - see docs/localization.md for all supported codes
7879

7980
# Add-on configuration (if needed)
8081
## Upload TFT

docs/install.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Follow these steps to add a new device in the ESPHome Dashboard:
116116
wifi_ssid: !secret wifi_ssid
117117
wifi_password: !secret wifi_password
118118
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
119+
language: en # Language code - see docs/localization.md for all supported codes
119120
boot_sound: false
120121
# Add-on configuration (if needed)
121122
## Upload TFT
@@ -226,8 +227,8 @@ The use of a non-conductive tool, like the blue plastic one shown in the picture
226227
| Panel's Board | TTL USB-to-Serial |
227228
| :--: | :--: |
228229
| `3V3` | `VCC`, `3V3`, or `3.3V` |
229-
| `TX` | `RX` |
230-
| `RX` | `TX` |
230+
| `TX` | `RX` |
231+
| `RX` | `TX` |
231232
| `GND` | `GND` |
232233
| `IO0` | `GND`<br>This can be connected to a `GND` pin on the panel's board. |
233234
<!-- markdownlint-enable MD033 -->
@@ -506,6 +507,7 @@ substitutions:
506507
wifi_ssid: !secret wifi_ssid
507508
wifi_password: !secret wifi_password
508509
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
510+
language: en # Language code - see docs/localization.md for all supported codes
509511
boot_sound: false
510512
# Add-on configuration (if needed)
511513
## Upload TFT
@@ -563,6 +565,7 @@ substitutions:
563565
wifi_ssid: !secret wifi_ssid
564566
wifi_password: !secret wifi_password
565567
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
568+
language: en # Language code - see docs/localization.md for all supported codes
566569
boot_sound: false
567570
# Add-on configuration (if needed)
568571
## Upload TFT
@@ -607,6 +610,7 @@ substitutions:
607610
wifi_ssid: !secret wifi_ssid
608611
wifi_password: !secret wifi_password
609612
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
613+
language: en # Language code - see docs/localization.md for all supported codes
610614
boot_sound: false
611615
# Add-on configuration (if needed)
612616
## Upload TFT
@@ -670,6 +674,7 @@ Here's a complete workflow for integrating Bluetooth Proxy while managing memory
670674
wifi_ssid: !secret wifi_ssid
671675
wifi_password: !secret wifi_password
672676
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
677+
language: en # Language code - see docs/localization.md for all supported codes
673678
boot_sound: false
674679
# Add-on configuration (if needed)
675680
## Upload TFT
@@ -700,6 +705,7 @@ Here's a complete workflow for integrating Bluetooth Proxy while managing memory
700705
wifi_ssid: !secret wifi_ssid
701706
wifi_password: !secret wifi_password
702707
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
708+
language: en # Language code - see docs/localization.md for all supported codes
703709
boot_sound: false
704710
# Add-on configuration (if needed)
705711
## Upload TFT
@@ -749,6 +755,7 @@ substitutions:
749755
wifi_ssid: !secret wifi_ssid
750756
wifi_password: !secret wifi_password
751757
ota_password: "" # Optional: set OTA password, or use ${wifi_password} for backward compatibility (see migration guide)
758+
language: en # Language code - see docs/localization.md for all supported codes
752759
boot_sound: false
753760
# Add-on configuration (if needed)
754761
## Upload TFT

0 commit comments

Comments
 (0)