Correct issue with discovery (#721)

* Correct issue with discovery

* Forget declaration for bl0602
This commit is contained in:
Dheenhasty
2023-03-11 18:03:54 +01:00
committed by GitHub
parent ac263958dd
commit 78965377a2
4 changed files with 14 additions and 8 deletions

View File

@ -179,7 +179,7 @@ static int http_tasmota_json_ENERGY(void* request, jsonCb_t printer) {
energy = DRV_GetReading(OBK_CONSUMPTION_TOTAL);
energy_hour = DRV_GetReading(OBK_CONSUMPTION_LAST_HOUR);
if (DRV_IsRunning("Battery")) {
if (DRV_IsMeasuringBattery()) {
#if defined(PLATFORM_BEKEN)
voltage = Battery_lastreading(OBK_BATT_VOLTAGE) / 1000.00;
batterypercentage = Battery_lastreading(OBK_BATT_LEVEL);
@ -261,7 +261,7 @@ static int http_tasmota_json_SENSOR(void* request, jsonCb_t printer) {
humidity = CHANNEL_GetFloat(channel_2);
// writer header
printer(request, "\"SHT3X\":");
printer(request, "\"CHT8305\":");
// following check will clear NaN values
printer(request, "{");
printer(request, "\"Temperature\": %.1f,", temperature);
@ -286,7 +286,7 @@ static int http_tasmota_json_status_SNS(void* request, jsonCb_t printer, bool bA
#ifndef OBK_DISABLE_ALL_DRIVERS
if (DRV_IsMeasuringPower()) {
if (DRV_IsMeasuringPower() || DRV_IsMeasuringBattery()) {
// begin ENERGY block
printer(request, ",");