mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-24 23:07:17 +00:00
print numbers as numbers in json, not strings.
This commit is contained in:
parent
25034c153a
commit
6e0cd5bd68
@ -696,14 +696,14 @@ void TuyaSerialInput(void)
|
||||
if (TUYA_CMD_STATE == Tuya.buffer[3]) {
|
||||
ResponseAppend_P(PSTR(",\"DpType%uId%u\":"), dpDataType, dpId);
|
||||
if (TUYA_TYPE_BOOL == dpDataType && dpDataLen == 1) {
|
||||
ResponseAppend_P(PSTR("\"%u\""), dpData[0]);
|
||||
ResponseAppend_P(PSTR("%u"), dpData[0]);
|
||||
} else if (TUYA_TYPE_VALUE == dpDataType && dpDataLen == 4) {
|
||||
uint32_t dpValue = (uint32_t)dpData[0] << 24 | (uint32_t)dpData[1] << 16 | (uint32_t)dpData[2] << 8 | (uint32_t)dpData[3] << 0;
|
||||
ResponseAppend_P(PSTR("\"%u\""), dpValue);
|
||||
ResponseAppend_P(PSTR("%u"), dpValue);
|
||||
} else if (TUYA_TYPE_STRING == dpDataType) {
|
||||
ResponseAppend_P(PSTR("\"%.*s\""), dpDataLen, dpData);
|
||||
} else if (TUYA_TYPE_ENUM == dpDataType && dpDataLen == 1) {
|
||||
ResponseAppend_P(PSTR("\"%u\""), dpData[0]);
|
||||
ResponseAppend_P(PSTR("%u"), dpData[0]);
|
||||
} else {
|
||||
ResponseAppend_P(PSTR("\"0x%s\""), dpHexData);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user