auto-formatting

This commit is contained in:
proddy
2021-07-19 16:55:41 +02:00
parent 37d001e7b5
commit dd3a0a706d
10 changed files with 116 additions and 121 deletions

View File

@@ -711,8 +711,7 @@ void Console::load_system_commands(unsigned int context) {
});
});
EMSESPShell::commands
->add_command(context,
EMSESPShell::commands->add_command(context,
CommandFlags::ADMIN,
flash_string_vector{F_(sensorname)},
flash_string_vector{F_(sensorid_optional), F_(name_optional), F_(offset_optional)},

View File

@@ -357,7 +357,8 @@ bool DallasSensor::add_name(const char * idstr, const char * name, int16_t offse
return ok;
}
EMSESP::webSettingsService.update([&](WebSettings & settings) {
EMSESP::webSettingsService.update(
[&](WebSettings & settings) {
// check for new name of stored id
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
if (strcmp(id, settings.sensor[i].id.c_str()) == 0) {
@@ -405,7 +406,8 @@ bool DallasSensor::add_name(const char * idstr, const char * name, int16_t offse
}
LOG_ERROR(F("List full, remove one sensorname first"));
return StateUpdateResult::UNCHANGED;
}, "local");
},
"local");
return ok;
}

View File

@@ -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));
}
// MQTT commands for boiler topic
register_device_value(
TAG_BOILER_DATA, &wWTapActivated_, DeviceValueType::BOOL, nullptr, FL_(wwtapactivated), DeviceValueUOM::BOOLEAN, MAKE_CF_CB(set_tapwarmwater_activated));
register_device_value(TAG_BOILER_DATA,
&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));
// add values
@@ -143,20 +148,10 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
FL_(maintenanceType),
DeviceValueUOM::LIST,
MAKE_CF_CB(set_maintenance));
register_device_value(TAG_BOILER_DATA,
&maintenanceTime_,
DeviceValueType::USHORT,
nullptr,
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));
register_device_value(
TAG_BOILER_DATA, &maintenanceTime_, DeviceValueType::USHORT, nullptr, 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
if (model() == EMS_DEVICE_FLAG_HEATPUMP) {
register_device_value(TAG_BOILER_DATA, &upTimeControl_, DeviceValueType::TIME, FL_(div60), FL_(upTimeControl), DeviceValueUOM::MINUTES);

View File

@@ -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
// only if it already hasn't been added
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
if (!mqtt_subfunctions_.empty()) {
for (auto & mqtt_subfunction : mqtt_subfunctions_) {