Fix IR compilation for ESP32 with Arduino3 (#19537)

This commit is contained in:
s-hadinger 2023-09-17 21:12:36 +02:00 committed by GitHub
parent ed33d61ab7
commit 2d0339e8bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -240,7 +240,7 @@ namespace {
if (modelStr != kUnknownStr) { if (modelStr != kUnknownStr) {
json.add(key, modelStr); json.add(key, modelStr);
} else { // Fallback to int value } else { // Fallback to int value
json.add(key, model); json.add(key, (int32_t)model);
} }
} }
} // namespace { } // namespace {
@ -258,13 +258,13 @@ String sendACJsonState(const stdAc::state_t &state) {
case stdAc::ac_command_t::kConfigCommand: case stdAc::ac_command_t::kConfigCommand:
// Note: for `kConfigCommand` the semantics of clock/sleep is abused IRremoteESP8266 lib-side for key/value pair // Note: for `kConfigCommand` the semantics of clock/sleep is abused IRremoteESP8266 lib-side for key/value pair
// Ref: lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRac.cpp[L3062-3066] // Ref: lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRac.cpp[L3062-3066]
json.add(PSTR(D_JSON_IRHVAC_CONFIG_KEY), state.clock); json.add(PSTR(D_JSON_IRHVAC_CONFIG_KEY), (int32_t)state.clock);
json.add(PSTR(D_JSON_IRHVAC_CONFIG_VALUE), state.sleep); json.add(PSTR(D_JSON_IRHVAC_CONFIG_VALUE), (int32_t)state.sleep);
break; break;
case stdAc::ac_command_t::kTimerCommand: case stdAc::ac_command_t::kTimerCommand:
json.add(PSTR(D_JSON_IRHVAC_POWER), IRac::boolToString(state.power)); json.add(PSTR(D_JSON_IRHVAC_POWER), IRac::boolToString(state.power));
if(state.clock != -1) { json.add(PSTR(D_JSON_IRHVAC_CLOCK), irutils::minsToString(state.clock)); } if(state.clock != -1) { json.add(PSTR(D_JSON_IRHVAC_CLOCK), irutils::minsToString(state.clock)); }
json.add(PSTR(D_JSON_IRHVAC_SLEEP), state.sleep); json.add(PSTR(D_JSON_IRHVAC_SLEEP), (int32_t)state.sleep);
break; break;
case stdAc::ac_command_t::kControlCommand: case stdAc::ac_command_t::kControlCommand:
default: default:
@ -288,8 +288,8 @@ String sendACJsonState(const stdAc::state_t &state) {
json.add(PSTR(D_JSON_IRHVAC_FILTER), IRac::boolToString(state.filter)); json.add(PSTR(D_JSON_IRHVAC_FILTER), IRac::boolToString(state.filter));
json.add(PSTR(D_JSON_IRHVAC_CLEAN), IRac::boolToString(state.clean)); json.add(PSTR(D_JSON_IRHVAC_CLEAN), IRac::boolToString(state.clean));
json.add(PSTR(D_JSON_IRHVAC_BEEP), IRac::boolToString(state.beep)); json.add(PSTR(D_JSON_IRHVAC_BEEP), IRac::boolToString(state.beep));
json.add(PSTR(D_JSON_IRHVAC_SLEEP), state.sleep); json.add(PSTR(D_JSON_IRHVAC_SLEEP), (int32_t)state.sleep);
if(state.clock != -1) { json.add(PSTR(D_JSON_IRHVAC_CLOCK), state.clock); } if(state.clock != -1) { json.add(PSTR(D_JSON_IRHVAC_CLOCK), (int32_t)state.clock); }
json.add(PSTR(D_JSON_IRHVAC_IFEEL), IRac::boolToString(state.iFeel)); json.add(PSTR(D_JSON_IRHVAC_IFEEL), IRac::boolToString(state.iFeel));
addFloatToJson(json, PSTR(D_JSON_IRHVAC_SENSOR_TEMP), state.sensorTemperature, kNoTempValue); addFloatToJson(json, PSTR(D_JSON_IRHVAC_SENSOR_TEMP), state.sensorTemperature, kNoTempValue);
break; break;