mirror of https://github.com/arendst/Tasmota.git
Fix compilation errors
This commit is contained in:
parent
2ff756b3cc
commit
31c6f7af3c
|
@ -360,6 +360,9 @@ uint32_t JsonParserObject::getUInt(const char * needle, uint32_t val) const {
|
||||||
uint64_t JsonParserObject::getULong(const char * needle, uint64_t val) const {
|
uint64_t JsonParserObject::getULong(const char * needle, uint64_t val) const {
|
||||||
return (*this)[needle].getULong(val);
|
return (*this)[needle].getULong(val);
|
||||||
}
|
}
|
||||||
|
float JsonParserObject::getFloat(const char * needle, float val) const {
|
||||||
|
return (*this)[needle].getFloat(val);
|
||||||
|
}
|
||||||
const char * JsonParserObject::getStr(const char * needle, const char * val) const {
|
const char * JsonParserObject::getStr(const char * needle, const char * val) const {
|
||||||
return (*this)[needle].getStr(val);
|
return (*this)[needle].getStr(val);
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,15 +204,15 @@ uint32_t IrRemoteCmndIrSendJson(void)
|
||||||
uint16_t repeat = root[UpperCase_P(parm_uc, PSTR(D_JSON_IR_REPEAT))];
|
uint16_t repeat = root[UpperCase_P(parm_uc, PSTR(D_JSON_IR_REPEAT))];
|
||||||
#else
|
#else
|
||||||
RemoveSpace(XdrvMailbox.data); // TODO is this really needed?
|
RemoveSpace(XdrvMailbox.data); // TODO is this really needed?
|
||||||
JsonParserObject root = JsonParser((chat*) XdrvMailbox.data).getRootObject();
|
JsonParserObject root = JsonParser((char*) XdrvMailbox.data).getRootObject();
|
||||||
if (!root) { return IE_INVALID_JSON; }
|
if (!root) { return IE_INVALID_JSON; }
|
||||||
|
|
||||||
// IRsend { "protocol": "SAMSUNG", "bits": 32, "data": 551502015 }
|
// IRsend { "protocol": "SAMSUNG", "bits": 32, "data": 551502015 }
|
||||||
// IRsend { "protocol": "NEC", "bits": 32, "data":"0x02FDFE80", "repeat": 2 }
|
// IRsend { "protocol": "NEC", "bits": 32, "data":"0x02FDFE80", "repeat": 2 }
|
||||||
const char *protocol = root.getStr(PSTR(D_JSON_IR_PROTOCOL));
|
const char *protocol = root.getStr(PSTR(D_JSON_IR_PROTOCOL), "");
|
||||||
uint16_t bits = root.getUInt(PSTR(D_JSON_IR_BITS));
|
uint16_t bits = root.getUInt(PSTR(D_JSON_IR_BITS), 0);
|
||||||
uint64_t data = root.getULong(PSTR(D_JSON_IR_DATA));
|
uint64_t data = root.getULong(PSTR(D_JSON_IR_DATA), 0);
|
||||||
uint16_t repeat = root.getUInt(PSTR(D_JSON_IR_REPEAT));
|
uint16_t repeat = root.getUInt(PSTR(D_JSON_IR_REPEAT), 0);
|
||||||
#endif
|
#endif
|
||||||
// check if the IRSend<x> is great than repeat
|
// check if the IRSend<x> is great than repeat
|
||||||
if (XdrvMailbox.index > repeat + 1) {
|
if (XdrvMailbox.index > repeat + 1) {
|
||||||
|
|
|
@ -311,8 +311,8 @@ uint32_t IrRemoteCmndIrHvacJson(void)
|
||||||
state.clean = false; // Turn off any Cleaning options if we can.
|
state.clean = false; // Turn off any Cleaning options if we can.
|
||||||
state.clock = -1; // Don't set any current time if we can avoid it.
|
state.clock = -1; // Don't set any current time if we can avoid it.
|
||||||
|
|
||||||
if (root[PSTR(D_JSON_IRHVAC_VENDOR)]) { state.protocol = strToDecodeType(root.getStr(PSTR(D_JSON_IRHVAC_VENDOR))); }
|
if (root[PSTR(D_JSON_IRHVAC_VENDOR)]) { state.protocol = strToDecodeType(root.getStr(PSTR(D_JSON_IRHVAC_VENDOR), "")); }
|
||||||
if (root[PSTR(D_JSON_IRHVAC_PROTOCOL)]) { state.protocol = strToDecodeType(root.getStr(PSTR(D_JSON_IRHVAC_PROTOCOL))); }
|
if (root[PSTR(D_JSON_IRHVAC_PROTOCOL)]) { state.protocol = strToDecodeType(root.getStr(PSTR(D_JSON_IRHVAC_PROTOCOL), "")); }
|
||||||
// UpperCase_P(parm_uc, PSTR(D_JSON_IRHVAC_VENDOR));
|
// UpperCase_P(parm_uc, PSTR(D_JSON_IRHVAC_VENDOR));
|
||||||
// if (json.containsKey(parm_uc)) { state.protocol = strToDecodeType(json[parm_uc]); }
|
// if (json.containsKey(parm_uc)) { state.protocol = strToDecodeType(json[parm_uc]); }
|
||||||
// UpperCase_P(parm_uc, PSTR(D_JSON_IRHVAC_PROTOCOL));
|
// UpperCase_P(parm_uc, PSTR(D_JSON_IRHVAC_PROTOCOL));
|
||||||
|
@ -331,10 +331,10 @@ uint32_t IrRemoteCmndIrHvacJson(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (root[PSTR(D_JSON_IRHVAC_MODEL)]) { state.model = IRac::strToModel(PSTR(D_JSON_IRHVAC_MODEL)]); }
|
if (root[PSTR(D_JSON_IRHVAC_MODEL)]) { state.model = IRac::strToModel(PSTR(D_JSON_IRHVAC_MODEL)); }
|
||||||
if (root[PSTR(D_JSON_IRHVAC_MODE)]) { state.mode = IRac::strToOpmode(PSTR(D_JSON_IRHVAC_MODE)]); }
|
if (root[PSTR(D_JSON_IRHVAC_MODE)]) { state.mode = IRac::strToOpmode(PSTR(D_JSON_IRHVAC_MODE)); }
|
||||||
if (root[PSTR(D_JSON_IRHVAC_SWINGV)]) { state.swingv = IRac::strToSwingV(PSTR(D_JSON_IRHVAC_SWINGV)]); }
|
if (root[PSTR(D_JSON_IRHVAC_SWINGV)]) { state.swingv = IRac::strToSwingV(PSTR(D_JSON_IRHVAC_SWINGV)); }
|
||||||
if (root[PSTR(D_JSON_IRHVAC_SWINGH)]) { state.swingh = IRac::strToSwingV(PSTR(D_JSON_IRHVAC_SWINGH)]); }
|
if (root[PSTR(D_JSON_IRHVAC_SWINGH)]) { state.swingh = IRac::strToSwingH(PSTR(D_JSON_IRHVAC_SWINGH)); }
|
||||||
state.degrees = root.getFloat(PSTR(D_JSON_IRHVAC_TEMP), state.degrees);
|
state.degrees = root.getFloat(PSTR(D_JSON_IRHVAC_TEMP), state.degrees);
|
||||||
// AddLog_P2(LOG_LEVEL_DEBUG, PSTR("model %d, mode %d, fanspeed %d, swingv %d, swingh %d"),
|
// AddLog_P2(LOG_LEVEL_DEBUG, PSTR("model %d, mode %d, fanspeed %d, swingv %d, swingh %d"),
|
||||||
// state.model, state.mode, state.fanspeed, state.swingv, state.swingh);
|
// state.model, state.mode, state.fanspeed, state.swingv, state.swingh);
|
||||||
|
|
Loading…
Reference in New Issue