mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-11 18:15:44 +00:00
Correct issue with discovery (#721)
* Correct issue with discovery * Forget declaration for bl0602
This commit is contained in:
@ -446,7 +446,7 @@ int http_fn_index(http_request_t* request) {
|
||||
poststr(request, "</td></tr>");
|
||||
|
||||
}
|
||||
else if (channelType == ChType_OffLowMidHigh || channelType == ChType_OffLowestLowMidHighHighest
|
||||
else if (channelType == ChType_OffLowMidHigh || channelType == ChType_OffLowestLowMidHighHighest
|
||||
|| channelType == ChType_LowestLowMidHighHighest || channelType == ChType_LowMidHighHighest
|
||||
|| channelType == ChType_OffLowMidHighHighest) {
|
||||
const char** types;
|
||||
@ -456,7 +456,7 @@ int http_fn_index(http_request_t* request) {
|
||||
const char* types6[] = { "Off", "Lowest", "Low", "Mid", "High", "Highest" };
|
||||
const char* types5NoOff[] = { "Lowest", "Low", "Mid", "High", "Highest" };
|
||||
int numTypes;
|
||||
|
||||
|
||||
if (channelType == ChType_OffLowMidHigh) {
|
||||
types = types4;
|
||||
numTypes = 4;
|
||||
@ -1641,9 +1641,7 @@ void doHomeAssistantDiscovery(const char* topic, http_request_t* request) {
|
||||
|
||||
#ifndef OBK_DISABLE_ALL_DRIVERS
|
||||
measuringPower = DRV_IsMeasuringPower();
|
||||
#endif
|
||||
#if defined(PLATFORM_BEKEN) || defined(WINDOWS)
|
||||
measuringBattery = DRV_IsRunning("Battery");
|
||||
measuringBattery = DRV_IsMeasuringBattery();
|
||||
#endif
|
||||
|
||||
get_Relay_PWM_Count(&relayCount, &pwmCount, &dInputCount);
|
||||
|
||||
@ -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, ",");
|
||||
|
||||
Reference in New Issue
Block a user