mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2025-10-29 11:33:20 +00:00
Add Chip internal temperature as sensor in JSON (#1821)
* Add MCU temperature to json_interface.c * Write chip temp even if there is no other sensor present * Send chip temperature always as sensor "ESP32"
This commit is contained in:
parent
f60d242fbb
commit
6279bcd07a
@ -264,6 +264,10 @@ static int http_tasmota_json_SENSOR(void* request, jsonCb_t printer) {
|
||||
float chan_val1, chan_val2;
|
||||
int channel_1, channel_2, g_pin_1 = 0;
|
||||
printer(request, ",");
|
||||
#ifndef NO_CHIP_TEMPERATURE
|
||||
// printer(request, "\"%s\":{\"Temperature\": %.1f},", PLATFORM_MCU_NAME, g_wifi_temperature);
|
||||
printer(request, "\"ESP32\":{\"Temperature\": %.1f},", g_wifi_temperature);
|
||||
#endif
|
||||
if (DRV_IsRunning("SHT3X")) {
|
||||
g_pin_1 = PIN_FindPinIndexForRole(IOR_SHT3X_DAT, g_pin_1);
|
||||
channel_1 = g_cfg.pins.channels[g_pin_1];
|
||||
@ -408,7 +412,11 @@ static int http_tasmota_json_status_SNS(void* request, jsonCb_t printer, bool bA
|
||||
bHasAnyDHT = true;
|
||||
break;
|
||||
}
|
||||
#ifdef NO_CHIP_TEMPERATURE
|
||||
if (DRV_IsSensor() || bHasAnyDHT) {
|
||||
#else
|
||||
if (1) {
|
||||
#endif
|
||||
http_tasmota_json_SENSOR(request, printer);
|
||||
JSON_PrintKeyValue_String(request, printer, "TempUnit", "C", false);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user