Add #define FIX_JSON_HEXADECIMAL to change JSON hexadecimal value "FF5F78" into "0xFF5F78" (#22919)

This commit is contained in:
Theo Arends 2025-02-02 16:08:50 +01:00
parent 943a0b1e6c
commit e8ca96008f
4 changed files with 7 additions and 1 deletions

View File

@ -23,6 +23,7 @@ All notable changes to this project will be documented in this file.
- LVGL `lv.set_paint_cb()` to register a callback when screen is refreshed (#22909)
- Berry `tasmota.settings` entries for PixelType (#22912)
- Support for C8-CO2-5K CO2 sensor (#22905)
- `#define FIX_JSON_HEXADECIMAL` to change JSON hexadecimal value "FF5F78" into "0xFF5F78" (#22919)
### Breaking Changed

View File

@ -124,6 +124,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Support for Senseair S88 CO2 sensor [#22733](https://github.com/arendst/Tasmota/issues/22733)
- Support for C8-CO2-5K CO2 sensor [#22905](https://github.com/arendst/Tasmota/issues/22905)
- Support for ESP32 Two-Wire Automotive Interface (TWAI) or Controller Area Network (CAN) busses
- `#define FIX_JSON_HEXADECIMAL` to change JSON hexadecimal value "FF5F78" into "0xFF5F78" [#22919](https://github.com/arendst/Tasmota/issues/22919)
- GPS driver select baudrate using GPIO GPS_RX1 (9600bps), GPS_RX2 (19200bps) or GPS_RX3 (38400bps) [#22869](https://github.com/arendst/Tasmota/issues/22869)
- I2S AAC support for web radio [#22787](https://github.com/arendst/Tasmota/issues/22787)
- I2S Opus stream and file support for opus/aac [#22795](https://github.com/arendst/Tasmota/issues/22795)

View File

@ -533,6 +533,7 @@
#define ROTARY_V1 // Add support for Rotary Encoder as used in MI Desk Lamp (+0k8 code)
#define ROTARY_MAX_STEPS 10 // Rotary step boundary
#define USE_SONOFF_RF // Add support for Sonoff Rf Bridge (+3k2 code)
// #define FIX_JSON_HEXADECIMAL // Add "0x" as prefix to hexadecimal value (disabled for legacy)
#define USE_RF_FLASH // Add support for flashing the EFM8BB1 chip on the Sonoff RF Bridge. C2CK must be connected to GPIO4, C2D to GPIO5 on the PCB (+2k7 code)
#define USE_SONOFF_SC // Add support for Sonoff Sc (+1k1 code)
#define USE_TUYA_MCU // Add support for Tuya Serial MCU
@ -902,7 +903,6 @@
// #define GM861_DECODE_AIM // Decode AIM-id (+0k3 code)
// #define GM861_HEARTBEAT // Enable heartbeat (+0k2 code)
//#define USE_WOOLIIS // Add support for Wooliis Hall Effect Coulometer or Battery capacity monitor (+1k6 code)
//#define USE_C8_CO2_5K // Add support for C8-CO2-5K CO2 Sensor (+4k3 code)
//#define USE_DALI // Add support for DALI gateway (+5k code)
// -- Power monitoring sensors --------------------

View File

@ -242,7 +242,11 @@ void SonoffBridgeReceived(void)
if (Settings->flag.rf_receive_decimal) { // SetOption28 - RF receive data format
snprintf_P(stemp, sizeof(stemp), PSTR("%u"), received_id);
} else {
#ifdef FIX_JSON_HEXADECIMAL
snprintf_P(stemp, sizeof(stemp), PSTR("\"0x%06X\""), received_id);
#else
snprintf_P(stemp, sizeof(stemp), PSTR("\"%06X\""), received_id);
#endif // FIX_JSON_HEXADECIMAL
}
ResponseTime_P(PSTR(",\"" D_JSON_RFRECEIVED "\":{\"" D_JSON_SYNC "\":%d,\"" D_JSON_LOW "\":%d,\"" D_JSON_HIGH "\":%d,\"" D_JSON_DATA "\":%s,\"" D_CMND_PREFIX_RF D_CMND_RFKEY "\":%s}}"),
sync_time, low_time, high_time, stemp, rfkey);