added "ON" and "OFF" for OpenHAB - #713

This commit is contained in:
proddy
2021-02-27 15:22:22 +01:00
parent 6b329ff20e
commit 513fab307e
4 changed files with 8 additions and 12 deletions

View File

@@ -127,6 +127,8 @@ char * Helpers::render_boolean(char * result, bool value) {
uint8_t bool_format_ = Mqtt::bool_format();
if (bool_format_ == BOOL_FORMAT_ONOFF) {
strlcpy(result, value ? "on" : "off", 5);
} else if (bool_format_ == BOOL_FORMAT_ONOFF_CAP) {
strlcpy(result, value ? "ON" : "OFF", 5);
} else if (bool_format_ == BOOL_FORMAT_TRUEFALSE) {
strlcpy(result, value ? "true" : "false", 7);
} else {