add option for rendering booleans on Dashboard #456

This commit is contained in:
MichaelDvP
2022-05-04 14:47:57 +02:00
parent e00da5a721
commit 5d2f648d03
11 changed files with 53 additions and 25 deletions

View File

@@ -66,6 +66,7 @@ void WebSettings::read(WebSettings & settings, JsonObject & root) {
root["board_profile"] = settings.board_profile;
root["fahrenheit"] = settings.fahrenheit;
root["bool_format"] = settings.bool_format;
root["bool_dashboard"] = settings.bool_dashboard;
root["enum_format"] = settings.enum_format;
root["weblog_level"] = settings.weblog_level;
root["weblog_buffer"] = settings.weblog_buffer;
@@ -225,6 +226,9 @@ StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings)
settings.bool_format = root["bool_format"] | EMSESP_DEFAULT_BOOL_FORMAT;
EMSESP::system_.bool_format(settings.bool_format);
settings.bool_dashboard = root["bool_dashboard"] | EMSESP_DEFAULT_BOOL_FORMAT;
EMSESP::system_.bool_dashboard(settings.bool_dashboard);
settings.enum_format = root["enum_format"] | EMSESP_DEFAULT_ENUM_FORMAT;
EMSESP::system_.enum_format(settings.enum_format);