mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
added "ON" and "OFF" for OpenHAB - #713
This commit is contained in:
@@ -158,9 +158,10 @@ class MqttSettingsForm extends React.Component<MqttSettingsFormProps> {
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
onChange={handleValueChange('bool_format')}
|
onChange={handleValueChange('bool_format')}
|
||||||
margin="normal">
|
margin="normal">
|
||||||
<MenuItem value={1}>on/off</MenuItem>
|
<MenuItem value={1}>"on"/"off"</MenuItem>
|
||||||
<MenuItem value={2}>true/false</MenuItem>
|
<MenuItem value={2}>true/false</MenuItem>
|
||||||
<MenuItem value={3}>1/0</MenuItem>
|
<MenuItem value={3}>1/0</MenuItem>
|
||||||
|
<MenuItem value={4}>"ON"/"OFF"</MenuItem>
|
||||||
</SelectValidator>
|
</SelectValidator>
|
||||||
<BlockFormControlLabel
|
<BlockFormControlLabel
|
||||||
control={
|
control={
|
||||||
|
|||||||
@@ -127,6 +127,8 @@ char * Helpers::render_boolean(char * result, bool value) {
|
|||||||
uint8_t bool_format_ = Mqtt::bool_format();
|
uint8_t bool_format_ = Mqtt::bool_format();
|
||||||
if (bool_format_ == BOOL_FORMAT_ONOFF) {
|
if (bool_format_ == BOOL_FORMAT_ONOFF) {
|
||||||
strlcpy(result, value ? "on" : "off", 5);
|
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) {
|
} else if (bool_format_ == BOOL_FORMAT_TRUEFALSE) {
|
||||||
strlcpy(result, value ? "true" : "false", 7);
|
strlcpy(result, value ? "true" : "false", 7);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ MAKE_PSTR_WORD(set)
|
|||||||
MAKE_PSTR_WORD(show)
|
MAKE_PSTR_WORD(show)
|
||||||
MAKE_PSTR_WORD(on)
|
MAKE_PSTR_WORD(on)
|
||||||
MAKE_PSTR_WORD(off)
|
MAKE_PSTR_WORD(off)
|
||||||
|
MAKE_PSTR_WORD(ON)
|
||||||
|
MAKE_PSTR_WORD(OFF)
|
||||||
MAKE_PSTR_WORD(su)
|
MAKE_PSTR_WORD(su)
|
||||||
MAKE_PSTR_WORD(name)
|
MAKE_PSTR_WORD(name)
|
||||||
MAKE_PSTR_WORD(auto)
|
MAKE_PSTR_WORD(auto)
|
||||||
@@ -211,16 +213,7 @@ MAKE_PSTR_WORD(holiday)
|
|||||||
MAKE_PSTR_WORD(reduce)
|
MAKE_PSTR_WORD(reduce)
|
||||||
|
|
||||||
// thermostat lists
|
// thermostat lists
|
||||||
MAKE_PSTR_LIST(enum_ibaMainDisplay,
|
MAKE_PSTR_LIST(enum_ibaMainDisplay, F_(internal_temperature), F_(internal_setpoint), F_(external_temperature), F_(burner_temperature), F_(WW_temperature), F_(functioning_mode), F_(time), F_(date), F_(smoke_temperature))
|
||||||
F_(internal_temperature),
|
|
||||||
F_(internal_setpoint),
|
|
||||||
F_(external_temperature),
|
|
||||||
F_(burner_temperature),
|
|
||||||
F_(WW_temperature),
|
|
||||||
F_(functioning_mode),
|
|
||||||
F_(time),
|
|
||||||
F_(date),
|
|
||||||
F_(smoke_temperature))
|
|
||||||
MAKE_PSTR_LIST(enum_ibaLanguage, F_(German), F_(Dutch), F_(French), F_(Italian))
|
MAKE_PSTR_LIST(enum_ibaLanguage, F_(German), F_(Dutch), F_(French), F_(Italian))
|
||||||
MAKE_PSTR_LIST(enum_floordrystatus, F_(off), F_(start), F_(heat), F_(hold), F_(cool), F_(end))
|
MAKE_PSTR_LIST(enum_floordrystatus, F_(off), F_(start), F_(heat), F_(hold), F_(cool), F_(end))
|
||||||
MAKE_PSTR_LIST(enum_ibaBuildingType, F_(blank), F_(light), F_(medium), F_(heavy))
|
MAKE_PSTR_LIST(enum_ibaBuildingType, F_(blank), F_(light), F_(medium), F_(heavy))
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ using uuid::console::Shell;
|
|||||||
// size of queue
|
// size of queue
|
||||||
#define MAX_MQTT_MESSAGES 100
|
#define MAX_MQTT_MESSAGES 100
|
||||||
|
|
||||||
enum { BOOL_FORMAT_ONOFF = 1, BOOL_FORMAT_TRUEFALSE, BOOL_FORMAT_10 }; // matches Web UI settings
|
enum { BOOL_FORMAT_ONOFF = 1, BOOL_FORMAT_TRUEFALSE, BOOL_FORMAT_10, BOOL_FORMAT_ONOFF_CAP }; // matches Web UI settings
|
||||||
|
|
||||||
namespace emsesp {
|
namespace emsesp {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user