mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
code cpplint optimizations
This commit is contained in:
@@ -1790,7 +1790,7 @@ void WebCallback(JsonObject root) {
|
|||||||
// send over EMS devices
|
// send over EMS devices
|
||||||
JsonArray list = emsbus.createNestedArray("devices");
|
JsonArray list = emsbus.createNestedArray("devices");
|
||||||
|
|
||||||
for (std::list<_Generic_Device>::iterator it = Devices.begin(); it != Devices.end(); it++) {
|
for (std::list<_Generic_Device>::iterator it = Devices.begin(); it != Devices.end(); ++it) {
|
||||||
JsonObject item = list.createNestedObject();
|
JsonObject item = list.createNestedObject();
|
||||||
item["type"] = (it)->model_type;
|
item["type"] = (it)->model_type;
|
||||||
item["model"] = (it)->model_string;
|
item["model"] = (it)->model_string;
|
||||||
|
|||||||
@@ -1823,7 +1823,7 @@ void _addDevice(uint8_t model_type, uint8_t product_id, uint8_t device_id, char
|
|||||||
_Generic_Device device;
|
_Generic_Device device;
|
||||||
// if its a duplicate don't add
|
// if its a duplicate don't add
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (std::list<_Generic_Device>::iterator it = Devices.begin(); it != Devices.end(); it++) {
|
for (std::list<_Generic_Device>::iterator it = Devices.begin(); it != Devices.end(); ++it) {
|
||||||
if (((it)->product_id == product_id) && ((it)->device_id == device_id)) {
|
if (((it)->product_id == product_id) && ((it)->device_id == device_id)) {
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
@@ -2560,9 +2560,9 @@ void ems_printDevices() {
|
|||||||
myDebug(s);
|
myDebug(s);
|
||||||
|
|
||||||
// print out the ones we recognized
|
// print out the ones we recognized
|
||||||
if (Devices.size() != 0) {
|
if (!Devices.empty()) {
|
||||||
myDebug_P(PSTR("and from those these %d were recognized as:"), Devices.size());
|
myDebug_P(PSTR("and from those these %d were recognized as:"), Devices.size());
|
||||||
for (std::list<_Generic_Device>::iterator it = Devices.begin(); it != Devices.end(); it++) {
|
for (std::list<_Generic_Device>::iterator it = Devices.begin(); it != Devices.end(); ++it) {
|
||||||
myDebug_P(PSTR(" %s%s%s (DeviceID:0x%02X ProductID:%d Version:%s)"),
|
myDebug_P(PSTR(" %s%s%s (DeviceID:0x%02X ProductID:%d Version:%s)"),
|
||||||
COLOR_BOLD_ON,
|
COLOR_BOLD_ON,
|
||||||
(it)->model_string,
|
(it)->model_string,
|
||||||
|
|||||||
@@ -398,7 +398,7 @@ typedef struct {
|
|||||||
char version[10];
|
char version[10];
|
||||||
char datetime[25]; // HH:MM:SS DD/MM/YYYY
|
char datetime[25]; // HH:MM:SS DD/MM/YYYY
|
||||||
bool write_supported;
|
bool write_supported;
|
||||||
_EMS_Thermostat_HC hc[EMS_THERMOSTAT_MAXHC - 1]; // array for the 4 heating circuits
|
_EMS_Thermostat_HC hc[EMS_THERMOSTAT_MAXHC]; // array for the 4 heating circuits
|
||||||
} _EMS_Thermostat;
|
} _EMS_Thermostat;
|
||||||
|
|
||||||
// call back function signature for processing telegram types
|
// call back function signature for processing telegram types
|
||||||
|
|||||||
Reference in New Issue
Block a user