mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
auto-formatting
This commit is contained in:
@@ -711,47 +711,46 @@ void Console::load_system_commands(unsigned int context) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
EMSESPShell::commands
|
EMSESPShell::commands->add_command(context,
|
||||||
->add_command(context,
|
CommandFlags::ADMIN,
|
||||||
CommandFlags::ADMIN,
|
flash_string_vector{F_(sensorname)},
|
||||||
flash_string_vector{F_(sensorname)},
|
flash_string_vector{F_(sensorid_optional), F_(name_optional), F_(offset_optional)},
|
||||||
flash_string_vector{F_(sensorid_optional), F_(name_optional), F_(offset_optional)},
|
[](Shell & shell, const std::vector<std::string> & arguments) {
|
||||||
[](Shell & shell, const std::vector<std::string> & arguments) {
|
if (arguments.size() == 0) {
|
||||||
if (arguments.size() == 0) {
|
EMSESP::webSettingsService.read([&](WebSettings & settings) {
|
||||||
EMSESP::webSettingsService.read([&](WebSettings & settings) {
|
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
||||||
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
if (!settings.sensor[i].id.isEmpty()) {
|
||||||
if (!settings.sensor[i].id.isEmpty()) {
|
shell.print(settings.sensor[i].id);
|
||||||
shell.print(settings.sensor[i].id);
|
shell.print(" : ");
|
||||||
shell.print(" : ");
|
shell.print(settings.sensor[i].name);
|
||||||
shell.print(settings.sensor[i].name);
|
shell.print(" : ");
|
||||||
shell.print(" : ");
|
char buf[10];
|
||||||
char buf[10];
|
shell.println(Helpers::render_value(buf, settings.sensor[i].offset, 10));
|
||||||
shell.println(Helpers::render_value(buf, settings.sensor[i].offset, 10));
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
return;
|
||||||
return;
|
}
|
||||||
}
|
if (arguments.size() == 1) {
|
||||||
if (arguments.size() == 1) {
|
EMSESP::dallassensor_.add_name(arguments.front().c_str(), "", 0);
|
||||||
EMSESP::dallassensor_.add_name(arguments.front().c_str(), "", 0);
|
// shell.println(EMSESP::dallassensor_.get_name(arguments.front().c_str()));
|
||||||
// shell.println(EMSESP::dallassensor_.get_name(arguments.front().c_str()));
|
return;
|
||||||
return;
|
}
|
||||||
}
|
int16_t offset = 0;
|
||||||
int16_t offset = 0;
|
float val;
|
||||||
float val;
|
if (arguments.size() == 2) {
|
||||||
if (arguments.size() == 2) {
|
if (Helpers::value2float(arguments.back().c_str(), val)) {
|
||||||
if (Helpers::value2float(arguments.back().c_str(), val)) {
|
offset = (10 * val);
|
||||||
offset = (10 * val);
|
EMSESP::dallassensor_.add_name(arguments.front().c_str(), "", offset);
|
||||||
EMSESP::dallassensor_.add_name(arguments.front().c_str(), "", offset);
|
return;
|
||||||
return;
|
}
|
||||||
}
|
} else if (arguments.size() == 3) {
|
||||||
} else if (arguments.size() == 3) {
|
if (Helpers::value2float(arguments.back().c_str(), val)) {
|
||||||
if (Helpers::value2float(arguments.back().c_str(), val)) {
|
offset = (10 * val);
|
||||||
offset = (10 * val);
|
}
|
||||||
}
|
}
|
||||||
}
|
EMSESP::dallassensor_.add_name(arguments.front().c_str(), arguments[1].c_str(), offset);
|
||||||
EMSESP::dallassensor_.add_name(arguments.front().c_str(), arguments[1].c_str(), offset);
|
});
|
||||||
});
|
|
||||||
|
|
||||||
EMSESPShell::commands
|
EMSESPShell::commands
|
||||||
->add_command(context,
|
->add_command(context,
|
||||||
|
|||||||
@@ -315,12 +315,12 @@ std::string DallasSensor::Sensor::to_string(const bool name) const {
|
|||||||
EMSESP::webSettingsService.read([&](WebSettings & settings) {
|
EMSESP::webSettingsService.read([&](WebSettings & settings) {
|
||||||
if (settings.dallas_format == Dallas_Format::NAME || name) {
|
if (settings.dallas_format == Dallas_Format::NAME || name) {
|
||||||
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
||||||
if (strcmp(settings.sensor[i].id.c_str(), str.c_str()) == 0) {
|
if (strcmp(settings.sensor[i].id.c_str(), str.c_str()) == 0) {
|
||||||
str = settings.sensor[i].name.c_str();
|
str = settings.sensor[i].name.c_str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
@@ -330,7 +330,7 @@ int16_t DallasSensor::Sensor::offset() const {
|
|||||||
int16_t offset = 0;
|
int16_t offset = 0;
|
||||||
EMSESP::webSettingsService.read([&](WebSettings & settings) {
|
EMSESP::webSettingsService.read([&](WebSettings & settings) {
|
||||||
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
||||||
if (strcmp(settings.sensor[i].id.c_str(), str.c_str()) == 0) {
|
if (strcmp(settings.sensor[i].id.c_str(), str.c_str()) == 0) {
|
||||||
offset = settings.sensor[i].offset;
|
offset = settings.sensor[i].offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -352,60 +352,62 @@ bool DallasSensor::add_name(const char * idstr, const char * name, int16_t offse
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check valid id
|
// check valid id
|
||||||
if (strlen(id) != 17 || id[2] != '-' || id[7] != '-' || id[12] !='-') {
|
if (strlen(id) != 17 || id[2] != '-' || id[7] != '-' || id[12] != '-') {
|
||||||
LOG_WARNING(F("Invalid sensor id: %s"), id);
|
LOG_WARNING(F("Invalid sensor id: %s"), id);
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
EMSESP::webSettingsService.update([&](WebSettings & settings) {
|
EMSESP::webSettingsService.update(
|
||||||
// check for new name of stored id
|
[&](WebSettings & settings) {
|
||||||
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
// check for new name of stored id
|
||||||
if (strcmp(id, settings.sensor[i].id.c_str()) == 0) {
|
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
||||||
if (strlen(name) == 0 && offset == 0) { // delete entry if name and offset is empty
|
if (strcmp(id, settings.sensor[i].id.c_str()) == 0) {
|
||||||
settings.sensor[i].id = "";
|
if (strlen(name) == 0 && offset == 0) { // delete entry if name and offset is empty
|
||||||
settings.sensor[i].name = "";
|
settings.sensor[i].id = "";
|
||||||
settings.sensor[i].offset = 0;
|
settings.sensor[i].name = "";
|
||||||
LOG_INFO(F("Deleting entry of sensor %s"), id);
|
settings.sensor[i].offset = 0;
|
||||||
} else {
|
LOG_INFO(F("Deleting entry of sensor %s"), id);
|
||||||
|
} else {
|
||||||
|
settings.sensor[i].name = (strlen(name) == 0) ? id : name;
|
||||||
|
settings.sensor[i].offset = offset;
|
||||||
|
LOG_INFO(F("Setting name of sensor %s to %s"), id, name);
|
||||||
|
}
|
||||||
|
ok = true;
|
||||||
|
return StateUpdateResult::CHANGED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// check for free place
|
||||||
|
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
||||||
|
if (settings.sensor[i].id.isEmpty()) {
|
||||||
|
settings.sensor[i].id = id;
|
||||||
settings.sensor[i].name = (strlen(name) == 0) ? id : name;
|
settings.sensor[i].name = (strlen(name) == 0) ? id : name;
|
||||||
settings.sensor[i].offset = offset;
|
settings.sensor[i].offset = offset;
|
||||||
LOG_INFO(F("Setting name of sensor %s to %s"), id, name);
|
LOG_INFO(F("Setting name of sensor %s to %s"), id, name);
|
||||||
}
|
ok = true;
|
||||||
ok = true;
|
return StateUpdateResult::CHANGED;
|
||||||
return StateUpdateResult::CHANGED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// check for free place
|
|
||||||
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
|
||||||
if (settings.sensor[i].id.isEmpty()) {
|
|
||||||
settings.sensor[i].id = id;
|
|
||||||
settings.sensor[i].name = (strlen(name) == 0) ? id : name;
|
|
||||||
settings.sensor[i].offset = offset;
|
|
||||||
LOG_INFO(F("Setting name of sensor %s to %s"), id, name);
|
|
||||||
ok = true;
|
|
||||||
return StateUpdateResult::CHANGED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// check if there is a unused id and overwrite it
|
|
||||||
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
|
||||||
bool found = false;
|
|
||||||
for (const auto & sensor : sensors_) {
|
|
||||||
if (strcmp(sensor.id_string().c_str(), settings.sensor[i].id.c_str()) == 0) {
|
|
||||||
found = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found) {
|
// check if there is a unused id and overwrite it
|
||||||
settings.sensor[i].id = id;
|
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
||||||
settings.sensor[i].name = (strlen(name) == 0) ? id : name;
|
bool found = false;
|
||||||
settings.sensor[i].offset = offset;
|
for (const auto & sensor : sensors_) {
|
||||||
LOG_INFO(F("Setting name of sensor %s to %s"), id, name);
|
if (strcmp(sensor.id_string().c_str(), settings.sensor[i].id.c_str()) == 0) {
|
||||||
ok = true;
|
found = true;
|
||||||
return StateUpdateResult::CHANGED;
|
}
|
||||||
|
}
|
||||||
|
if (!found) {
|
||||||
|
settings.sensor[i].id = id;
|
||||||
|
settings.sensor[i].name = (strlen(name) == 0) ? id : name;
|
||||||
|
settings.sensor[i].offset = offset;
|
||||||
|
LOG_INFO(F("Setting name of sensor %s to %s"), id, name);
|
||||||
|
ok = true;
|
||||||
|
return StateUpdateResult::CHANGED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
LOG_ERROR(F("List full, remove one sensorname first"));
|
||||||
LOG_ERROR(F("List full, remove one sensorname first"));
|
return StateUpdateResult::UNCHANGED;
|
||||||
return StateUpdateResult::UNCHANGED;
|
},
|
||||||
}, "local");
|
"local");
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,8 +85,13 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
|||||||
register_telegram_type(0x48F, F("HpOutdoor"), false, MAKE_PF_CB(process_HpOutdoor));
|
register_telegram_type(0x48F, F("HpOutdoor"), false, MAKE_PF_CB(process_HpOutdoor));
|
||||||
}
|
}
|
||||||
// MQTT commands for boiler topic
|
// MQTT commands for boiler topic
|
||||||
register_device_value(
|
register_device_value(TAG_BOILER_DATA,
|
||||||
TAG_BOILER_DATA, &wWTapActivated_, DeviceValueType::BOOL, nullptr, FL_(wwtapactivated), DeviceValueUOM::BOOLEAN, MAKE_CF_CB(set_tapwarmwater_activated));
|
&wWTapActivated_,
|
||||||
|
DeviceValueType::BOOL,
|
||||||
|
nullptr,
|
||||||
|
FL_(wwtapactivated),
|
||||||
|
DeviceValueUOM::BOOLEAN,
|
||||||
|
MAKE_CF_CB(set_tapwarmwater_activated));
|
||||||
register_device_value(TAG_BOILER_DATA, &dummy8u_, DeviceValueType::CMD, FL_(enum_reset), FL_(reset), DeviceValueUOM::LIST, MAKE_CF_CB(set_reset));
|
register_device_value(TAG_BOILER_DATA, &dummy8u_, DeviceValueType::CMD, FL_(enum_reset), FL_(reset), DeviceValueUOM::LIST, MAKE_CF_CB(set_reset));
|
||||||
|
|
||||||
// add values
|
// add values
|
||||||
@@ -143,20 +148,10 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
|||||||
FL_(maintenanceType),
|
FL_(maintenanceType),
|
||||||
DeviceValueUOM::LIST,
|
DeviceValueUOM::LIST,
|
||||||
MAKE_CF_CB(set_maintenance));
|
MAKE_CF_CB(set_maintenance));
|
||||||
register_device_value(TAG_BOILER_DATA,
|
register_device_value(
|
||||||
&maintenanceTime_,
|
TAG_BOILER_DATA, &maintenanceTime_, DeviceValueType::USHORT, nullptr, FL_(maintenanceTime), DeviceValueUOM::HOURS, MAKE_CF_CB(set_maintenancetime));
|
||||||
DeviceValueType::USHORT,
|
register_device_value(
|
||||||
nullptr,
|
TAG_BOILER_DATA, &maintenanceDate_, DeviceValueType::TEXT, nullptr, FL_(maintenanceDate), DeviceValueUOM::NONE, MAKE_CF_CB(set_maintenancedate));
|
||||||
FL_(maintenanceTime),
|
|
||||||
DeviceValueUOM::HOURS,
|
|
||||||
MAKE_CF_CB(set_maintenancetime));
|
|
||||||
register_device_value(TAG_BOILER_DATA,
|
|
||||||
&maintenanceDate_,
|
|
||||||
DeviceValueType::TEXT,
|
|
||||||
nullptr,
|
|
||||||
FL_(maintenanceDate),
|
|
||||||
DeviceValueUOM::NONE,
|
|
||||||
MAKE_CF_CB(set_maintenancedate));
|
|
||||||
// heatpump info
|
// heatpump info
|
||||||
if (model() == EMS_DEVICE_FLAG_HEATPUMP) {
|
if (model() == EMS_DEVICE_FLAG_HEATPUMP) {
|
||||||
register_device_value(TAG_BOILER_DATA, &upTimeControl_, DeviceValueType::TIME, FL_(div60), FL_(upTimeControl), DeviceValueUOM::MINUTES);
|
register_device_value(TAG_BOILER_DATA, &upTimeControl_, DeviceValueType::TIME, FL_(div60), FL_(upTimeControl), DeviceValueUOM::MINUTES);
|
||||||
@@ -305,7 +300,7 @@ void Boiler::check_active(const bool force) {
|
|||||||
|
|
||||||
// check if we can use tapactivated in flow systems
|
// check if we can use tapactivated in flow systems
|
||||||
if ((wWType_ == 1) && !Helpers::hasValue(wWTapActivated_, EMS_VALUE_BOOL)) {
|
if ((wWType_ == 1) && !Helpers::hasValue(wWTapActivated_, EMS_VALUE_BOOL)) {
|
||||||
wWTapActivated_= 1;
|
wWTapActivated_ = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if tap water is active, bits 1 and 4 must be set
|
// check if tap water is active, bits 1 and 4 must be set
|
||||||
@@ -1160,7 +1155,7 @@ bool Boiler::set_tapwarmwater_activated(const char * value, const int8_t id) {
|
|||||||
message_data[1] = 0x00; // burner output 0%
|
message_data[1] = 0x00; // burner output 0%
|
||||||
message_data[3] = 0x64; // boiler pump capacity 100%
|
message_data[3] = 0x64; // boiler pump capacity 100%
|
||||||
message_data[4] = 0xFF; // 3-way valve hot water only
|
message_data[4] = 0xFF; // 3-way valve hot water only
|
||||||
wWTapActivated_= 0;
|
wWTapActivated_ = 0;
|
||||||
} else {
|
} else {
|
||||||
// get out of test mode. Send all zeros.
|
// get out of test mode. Send all zeros.
|
||||||
// telegram: 0B 08 1D 00 00
|
// telegram: 0B 08 1D 00 00
|
||||||
|
|||||||
@@ -1105,9 +1105,9 @@ void Thermostat::process_RCErrorMessage(std::shared_ptr<const Telegram> telegram
|
|||||||
if (telegram->message_data[4] & 0x80) { // valid date
|
if (telegram->message_data[4] & 0x80) { // valid date
|
||||||
char code[3];
|
char code[3];
|
||||||
uint16_t codeNo = EMS_VALUE_USHORT_NOTSET;
|
uint16_t codeNo = EMS_VALUE_USHORT_NOTSET;
|
||||||
code[0] = telegram->message_data[0];
|
code[0] = telegram->message_data[0];
|
||||||
code[1] = telegram->message_data[1];
|
code[1] = telegram->message_data[1];
|
||||||
code[2] = 0;
|
code[2] = 0;
|
||||||
telegram->read_value(codeNo, 2);
|
telegram->read_value(codeNo, 2);
|
||||||
uint16_t year = (telegram->message_data[4] & 0x7F) + 2000;
|
uint16_t year = (telegram->message_data[4] & 0x7F) + 2000;
|
||||||
uint8_t month = telegram->message_data[5];
|
uint8_t month = telegram->message_data[5];
|
||||||
|
|||||||
@@ -582,7 +582,7 @@ void EMSdevice::generate_values_json_web(JsonObject & json) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// handle commands without value
|
// handle commands without value
|
||||||
else if(dv.type == DeviceValueType::CMD) {
|
else if (dv.type == DeviceValueType::CMD) {
|
||||||
obj = data.createNestedObject();
|
obj = data.createNestedObject();
|
||||||
obj["v"] = "";
|
obj["v"] = "";
|
||||||
}
|
}
|
||||||
@@ -881,7 +881,7 @@ bool EMSdevice::generate_values_json(JsonObject & root, const uint8_t tag_filter
|
|||||||
} else {
|
} else {
|
||||||
json[name] = (uint8_t)(*(uint8_t *)(dv.value_p)) ? 1 : 0;
|
json[name] = (uint8_t)(*(uint8_t *)(dv.value_p)) ? 1 : 0;
|
||||||
}
|
}
|
||||||
has_value = true;
|
has_value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle TEXT strings
|
// handle TEXT strings
|
||||||
|
|||||||
@@ -175,8 +175,8 @@ MAKE_PSTR(w, "W")
|
|||||||
MAKE_PSTR(kb, "KB")
|
MAKE_PSTR(kb, "KB")
|
||||||
MAKE_PSTR(seconds, "seconds")
|
MAKE_PSTR(seconds, "seconds")
|
||||||
MAKE_PSTR(dbm, "dBm")
|
MAKE_PSTR(dbm, "dBm")
|
||||||
MAKE_PSTR(num, " ") // this is hack so HA renders numbers correctly
|
MAKE_PSTR(num, " ") // this is hack so HA renders numbers correctly
|
||||||
MAKE_PSTR(bool, " ") // this is hack so HA renders numbers correctly
|
MAKE_PSTR(bool, " ") // this is hack so HA renders numbers correctly
|
||||||
MAKE_PSTR(blank, " ") // this is hack so HA renders numbers correctly
|
MAKE_PSTR(blank, " ") // this is hack so HA renders numbers correctly
|
||||||
|
|
||||||
// TAG mapping - maps to DeviceValueTAG_s in emsdevice.cpp
|
// TAG mapping - maps to DeviceValueTAG_s in emsdevice.cpp
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ uuid::log::Logger Mqtt::logger_{F_(mqtt), uuid::log::Facility::DAEMON};
|
|||||||
// subscribe to an MQTT topic, and store the associated callback function
|
// subscribe to an MQTT topic, and store the associated callback function
|
||||||
// only if it already hasn't been added
|
// only if it already hasn't been added
|
||||||
void Mqtt::subscribe(const uint8_t device_type, const std::string & topic, mqtt_subfunction_p cb) {
|
void Mqtt::subscribe(const uint8_t device_type, const std::string & topic, mqtt_subfunction_p cb) {
|
||||||
|
|
||||||
// check if we already have the topic subscribed, if so don't add it again
|
// check if we already have the topic subscribed, if so don't add it again
|
||||||
if (!mqtt_subfunctions_.empty()) {
|
if (!mqtt_subfunctions_.empty()) {
|
||||||
for (auto & mqtt_subfunction : mqtt_subfunctions_) {
|
for (auto & mqtt_subfunction : mqtt_subfunctions_) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ WebDevicesService::WebDevicesService(AsyncWebServer * server, SecurityManager *
|
|||||||
, _writevalue_dataHandler(WRITE_VALUE_SERVICE_PATH,
|
, _writevalue_dataHandler(WRITE_VALUE_SERVICE_PATH,
|
||||||
securityManager->wrapCallback(std::bind(&WebDevicesService::write_value, this, _1, _2), AuthenticationPredicates::IS_ADMIN))
|
securityManager->wrapCallback(std::bind(&WebDevicesService::write_value, this, _1, _2), AuthenticationPredicates::IS_ADMIN))
|
||||||
, _writesensor_dataHandler(WRITE_SENSOR_SERVICE_PATH,
|
, _writesensor_dataHandler(WRITE_SENSOR_SERVICE_PATH,
|
||||||
securityManager->wrapCallback(std::bind(&WebDevicesService::write_sensor, this, _1, _2), AuthenticationPredicates::IS_ADMIN)) {
|
securityManager->wrapCallback(std::bind(&WebDevicesService::write_sensor, this, _1, _2), AuthenticationPredicates::IS_ADMIN)) {
|
||||||
server->on(EMSESP_DEVICES_SERVICE_PATH,
|
server->on(EMSESP_DEVICES_SERVICE_PATH,
|
||||||
HTTP_GET,
|
HTTP_GET,
|
||||||
securityManager->wrapRequest(std::bind(&WebDevicesService::all_devices, this, _1), AuthenticationPredicates::IS_AUTHENTICATED));
|
securityManager->wrapRequest(std::bind(&WebDevicesService::all_devices, this, _1), AuthenticationPredicates::IS_AUTHENTICATED));
|
||||||
@@ -178,7 +178,7 @@ void WebDevicesService::write_sensor(AsyncWebServerRequest * request, JsonVarian
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ok = EMSESP::dallassensor_.add_name(nostr, name, offset);
|
ok = EMSESP::dallassensor_.add_name(nostr, name, offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AsyncWebServerResponse * response = request->beginResponse(ok ? 200 : 204);
|
AsyncWebServerResponse * response = request->beginResponse(ok ? 200 : 204);
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class WebLogService : public uuid::log::Handler {
|
|||||||
unsigned long log_message_id_ = 0; // The next identifier to use for queued log messages
|
unsigned long log_message_id_ = 0; // The next identifier to use for queued log messages
|
||||||
unsigned long log_message_id_tail_ = 0; // last event shown on the screen after fetch
|
unsigned long log_message_id_tail_ = 0; // last event shown on the screen after fetch
|
||||||
std::list<QueuedLogMessage> log_messages_; // Queued log messages, in the order they were received
|
std::list<QueuedLogMessage> log_messages_; // Queued log messages, in the order they were received
|
||||||
time_t time_offset_ = 0;
|
time_t time_offset_ = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace emsesp
|
} // namespace emsesp
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
namespace emsesp {
|
namespace emsesp {
|
||||||
|
|
||||||
enum { BOOL_FORMAT_ONOFF = 1, BOOL_FORMAT_ONOFF_CAP, BOOL_FORMAT_TRUEFALSE, BOOL_FORMAT_10 }; // matches Web UI settings
|
enum { BOOL_FORMAT_ONOFF = 1, BOOL_FORMAT_ONOFF_CAP, BOOL_FORMAT_TRUEFALSE, BOOL_FORMAT_10 }; // matches Web UI settings
|
||||||
enum { ENUM_FORMAT_TEXT = 1, ENUM_FORMAT_NUMBER }; // matches Web UI settings
|
enum { ENUM_FORMAT_TEXT = 1, ENUM_FORMAT_NUMBER }; // matches Web UI settings
|
||||||
|
|
||||||
class WebSettings {
|
class WebSettings {
|
||||||
public:
|
public:
|
||||||
@@ -66,9 +66,9 @@ class WebSettings {
|
|||||||
uint8_t enum_format;
|
uint8_t enum_format;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
String id;
|
String id;
|
||||||
String name;
|
String name;
|
||||||
int16_t offset;
|
int16_t offset;
|
||||||
} sensor[NUM_SENSOR_NAMES];
|
} sensor[NUM_SENSOR_NAMES];
|
||||||
|
|
||||||
static void read(WebSettings & settings, JsonObject & root);
|
static void read(WebSettings & settings, JsonObject & root);
|
||||||
|
|||||||
Reference in New Issue
Block a user