Store display charset on ESPHome

Supports #1359
This commit is contained in:
Edward Firmo
2023-12-15 23:18:18 +01:00
parent 0cbb0b248a
commit 07cff9da83

View File

@@ -817,6 +817,12 @@ globals:
restore_value: true
initial_value: '0'
##### Charset (1 = International (original), 2 = CJK languages)
- id: display_charset
type: uint
restore_value: true
initial_value: '0'
##### Is embedded thermostat set as main climate entity? #####
- id: is_embedded_thermostat
type: bool
@@ -1563,6 +1569,15 @@ text_sensor:
if (display_mode_float > 0) id(display_mode) = int(display_mode_float);
}
// Detect display charset
if (doc.containsKey("charset"))
{
std::string charset_str = doc["charset"];
ESP_LOGV(TAG, "charset: %s", charset_str.c_str());
float charset_float = stof(charset_str);
if (charset_float > 0) id(display_charset) = int(charset_float);
}
// Contruct page boot
page_boot->execute(true);