add clock to controller #439

This commit is contained in:
MichaelDvP
2022-04-08 10:02:24 +02:00
parent f9b2a71b86
commit f771bb8043
4 changed files with 29 additions and 2 deletions

View File

@@ -77,7 +77,7 @@ void WebDataService::core_data(AsyncWebServerRequest * request) {
// Ignore Contoller
JsonArray devices = root.createNestedArray("devices");
for (const auto & emsdevice : EMSESP::emsdevices) {
if (emsdevice && emsdevice->device_type() != EMSdevice::DeviceType::CONTROLLER) {
if (emsdevice && (emsdevice->device_type() != EMSdevice::DeviceType::CONTROLLER || emsdevice->count_entities() > 0)) {
JsonObject obj = devices.createNestedObject();
obj["i"] = emsdevice->unique_id(); // a unique id
obj["t"] = emsdevice->device_type_name(); // type