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

@@ -176,8 +176,8 @@ char * Helpers::smallitoa(char * result, const uint16_t value) {
// work out how to display booleans
// for strings only
char * Helpers::render_boolean(char * result, bool value) {
uint8_t bool_format_ = EMSESP::system_.bool_format();
char * Helpers::render_boolean(char * result, const bool value, const bool dashboard) {
uint8_t bool_format_ = dashboard ? EMSESP::system_.bool_dashboard() : EMSESP::system_.bool_format();
if (bool_format_ == BOOL_FORMAT_ONOFF_STR) {
strlcpy(result, value ? read_flash_string(F_(on)).c_str() : read_flash_string(F_(off)).c_str(), 5);
} else if (bool_format_ == BOOL_FORMAT_ONOFF_STR_CAP) {