fix dashboard/disabled analog sensors

This commit is contained in:
proddy
2024-10-13 09:21:56 +01:00
parent e40d01ff87
commit 55bcc4410b
2 changed files with 4 additions and 4 deletions

View File

@@ -400,8 +400,8 @@ void WebDataService::dashboard_data(AsyncWebServerRequest * request) {
}
}
// add analog sensors
if (EMSESP::analog_enabled() && EMSESP::analogsensor_.have_sensors()) {
// add analog sensors, count excludes disabled entries
if (EMSESP::analog_enabled() && EMSESP::analogsensor_.count_entities(false)) {
JsonObject obj = root.add<JsonObject>();
obj["id"] = EMSdevice::DeviceTypeUniqueID::ANALOGSENSOR_UID; // it's unique id
obj["t"] = EMSdevice::DeviceType::ANALOGSENSOR; // device type number