mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
minor formatting
This commit is contained in:
@@ -114,7 +114,7 @@ std::string EMSdevice::device_type_2_device_name(const uint8_t device_type) {
|
|||||||
// returns device_type from a string
|
// returns device_type from a string
|
||||||
uint8_t EMSdevice::device_name_2_device_type(const char * topic) {
|
uint8_t EMSdevice::device_name_2_device_type(const char * topic) {
|
||||||
if (!topic) {
|
if (!topic) {
|
||||||
return DeviceType::UNKNOWN; // nullptr
|
return DeviceType::UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert topic to lowercase and compare
|
// convert topic to lowercase and compare
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ MAKE_PSTR(bufferedflow, "Durchlaufspeicher")
|
|||||||
MAKE_PSTR(layeredbuffer, "Schichtspeicher")
|
MAKE_PSTR(layeredbuffer, "Schichtspeicher")
|
||||||
MAKE_PSTR(maintenance, "Wartung")
|
MAKE_PSTR(maintenance, "Wartung")
|
||||||
MAKE_PSTR(heating, "Heizen")
|
MAKE_PSTR(heating, "Heizen")
|
||||||
MAKE_PSTR(cooling, "K<EFBFBD>hlen")
|
MAKE_PSTR(cooling, "K<EFBFBD>hlen")
|
||||||
|
|
||||||
// boiler lists
|
// boiler lists
|
||||||
MAKE_PSTR_LIST(tpl_date, F("Format: < dd.mm.yyyy >")) // template for text input
|
MAKE_PSTR_LIST(tpl_date, F("Format: < dd.mm.yyyy >")) // template for text input
|
||||||
@@ -312,7 +312,7 @@ MAKE_PSTR(winter, "Winter")
|
|||||||
MAKE_PSTR(outdoor, "Aussentemperatur")
|
MAKE_PSTR(outdoor, "Aussentemperatur")
|
||||||
MAKE_PSTR_WORD(mpc)
|
MAKE_PSTR_WORD(mpc)
|
||||||
MAKE_PSTR(room, "Raum")
|
MAKE_PSTR(room, "Raum")
|
||||||
MAKE_PSTR(room_outdoor, "Raum+Au<41>en")
|
MAKE_PSTR(room_outdoor, "Raum+Au<41>en")
|
||||||
MAKE_PSTR(power, "Leistung")
|
MAKE_PSTR(power, "Leistung")
|
||||||
MAKE_PSTR(constant, "konstant")
|
MAKE_PSTR(constant, "konstant")
|
||||||
MAKE_PSTR(simple, "einfach")
|
MAKE_PSTR(simple, "einfach")
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// SUrlParser from https://github.com/Mad-ness/simple-url-parser
|
|
||||||
|
|
||||||
#include "emsesp.h"
|
#include "emsesp.h"
|
||||||
|
|
||||||
using namespace std::placeholders; // for `_1` etc
|
using namespace std::placeholders; // for `_1` etc
|
||||||
|
|||||||
@@ -74,10 +74,10 @@ void WebDataService::core_data(AsyncWebServerRequest * request) {
|
|||||||
JsonObject root = response->getRoot();
|
JsonObject root = response->getRoot();
|
||||||
|
|
||||||
// list is already sorted by device type
|
// list is already sorted by device type
|
||||||
// Ignore Contoller
|
|
||||||
JsonArray devices = root.createNestedArray("devices");
|
JsonArray devices = root.createNestedArray("devices");
|
||||||
char buffer[3];
|
char buffer[3];
|
||||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||||
|
// ignore controller
|
||||||
if (emsdevice && (emsdevice->device_type() != EMSdevice::DeviceType::CONTROLLER || emsdevice->count_entities() > 0)) {
|
if (emsdevice && (emsdevice->device_type() != EMSdevice::DeviceType::CONTROLLER || emsdevice->count_entities() > 0)) {
|
||||||
JsonObject obj = devices.createNestedObject();
|
JsonObject obj = devices.createNestedObject();
|
||||||
obj["id"] = Helpers::smallitoa(buffer, emsdevice->unique_id()); // a unique id as a string
|
obj["id"] = Helpers::smallitoa(buffer, emsdevice->unique_id()); // a unique id as a string
|
||||||
|
|||||||
Reference in New Issue
Block a user