mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
automatic formatting
This commit is contained in:
@@ -30,6 +30,12 @@ class DummySettings {
|
|||||||
String jwtSecret = "ems-esp";
|
String jwtSecret = "ems-esp";
|
||||||
String ssid = "ems-esp";
|
String ssid = "ems-esp";
|
||||||
String password = "ems-esp";
|
String password = "ems-esp";
|
||||||
|
uint16_t publish_time_boiler;
|
||||||
|
uint16_t publish_time_thermostat;
|
||||||
|
uint16_t publish_time_solar;
|
||||||
|
uint16_t publish_time_mixing;
|
||||||
|
uint16_t publish_time_other;
|
||||||
|
uint16_t publish_time_sensor;
|
||||||
|
|
||||||
static void read(DummySettings & settings, JsonObject & root){};
|
static void read(DummySettings & settings, JsonObject & root){};
|
||||||
static void read(DummySettings & settings){};
|
static void read(DummySettings & settings){};
|
||||||
|
|||||||
@@ -486,8 +486,8 @@ bool EMSESP::process_telegram(std::shared_ptr<const Telegram> telegram) {
|
|||||||
LOG_NOTICE(pretty_telegram(telegram).c_str());
|
LOG_NOTICE(pretty_telegram(telegram).c_str());
|
||||||
read_id_ = WATCH_ID_NONE;
|
read_id_ = WATCH_ID_NONE;
|
||||||
} else if (watch() == WATCH_ON) {
|
} else if (watch() == WATCH_ON) {
|
||||||
if ((watch_id_ == WATCH_ID_NONE) || (telegram->type_id == watch_id_) ||
|
if ((watch_id_ == WATCH_ID_NONE) || (telegram->type_id == watch_id_)
|
||||||
((watch_id_ < 0x80) && ((telegram->src == watch_id_) || (telegram->dest == watch_id_)))) {
|
|| ((watch_id_ < 0x80) && ((telegram->src == watch_id_) || (telegram->dest == watch_id_)))) {
|
||||||
LOG_NOTICE(pretty_telegram(telegram).c_str());
|
LOG_NOTICE(pretty_telegram(telegram).c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,10 @@ void Sensors::reload() {
|
|||||||
mqtt_format_ = settings.mqtt_format; // single, nested or ha
|
mqtt_format_ = settings.mqtt_format; // single, nested or ha
|
||||||
});
|
});
|
||||||
|
|
||||||
EMSESP::emsespSettingsService.read([&](EMSESPSettings & settings) { dallas_gpio_ = settings.dallas_gpio; parasite_ = settings.dallas_parasite; });
|
EMSESP::emsespSettingsService.read([&](EMSESPSettings & settings) {
|
||||||
|
dallas_gpio_ = settings.dallas_gpio;
|
||||||
|
parasite_ = settings.dallas_parasite;
|
||||||
|
});
|
||||||
|
|
||||||
if (mqtt_format_ == MQTT_format::HA) {
|
if (mqtt_format_ == MQTT_format::HA) {
|
||||||
for (uint8_t i = 0; i < MAX_SENSORS; registered_ha_[i++] = false)
|
for (uint8_t i = 0; i < MAX_SENSORS; registered_ha_[i++] = false)
|
||||||
|
|||||||
@@ -250,6 +250,8 @@ void System::measure_analog() {
|
|||||||
uint16_t a = analogRead(A0);
|
uint16_t a = analogRead(A0);
|
||||||
#elif defined(ESP32)
|
#elif defined(ESP32)
|
||||||
uint16_t a = analogRead(36);
|
uint16_t a = analogRead(36);
|
||||||
|
#else
|
||||||
|
uint16_t a = 0; // standalone
|
||||||
#endif
|
#endif
|
||||||
static uint32_t sum_ = 0;
|
static uint32_t sum_ = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,8 @@ void RxService::add(uint8_t * data, uint8_t length) {
|
|||||||
// if we're watching and "raw" print out actual telegram as bytes to the console
|
// if we're watching and "raw" print out actual telegram as bytes to the console
|
||||||
if (EMSESP::watch() == EMSESP::Watch::WATCH_RAW) {
|
if (EMSESP::watch() == EMSESP::Watch::WATCH_RAW) {
|
||||||
uint16_t trace_watch_id = EMSESP::watch_id();
|
uint16_t trace_watch_id = EMSESP::watch_id();
|
||||||
if ((trace_watch_id == WATCH_ID_NONE) || (type_id == trace_watch_id) || ((trace_watch_id < 0x80) && ((src == trace_watch_id) || (dest == trace_watch_id)))) {
|
if ((trace_watch_id == WATCH_ID_NONE) || (type_id == trace_watch_id)
|
||||||
|
|| ((trace_watch_id < 0x80) && ((src == trace_watch_id) || (dest == trace_watch_id)))) {
|
||||||
LOG_NOTICE(F("Rx: %s"), Helpers::data_to_hex(data, length).c_str());
|
LOG_NOTICE(F("Rx: %s"), Helpers::data_to_hex(data, length).c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user