mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
auto-formatting
This commit is contained in:
@@ -711,8 +711,7 @@ 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)},
|
||||||
|
|||||||
@@ -357,7 +357,8 @@ bool DallasSensor::add_name(const char * idstr, const char * name, int16_t offse
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
EMSESP::webSettingsService.update([&](WebSettings & settings) {
|
EMSESP::webSettingsService.update(
|
||||||
|
[&](WebSettings & settings) {
|
||||||
// check for new name of stored id
|
// check for new name of stored id
|
||||||
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
for (uint8_t i = 0; i < NUM_SENSOR_NAMES; i++) {
|
||||||
if (strcmp(id, settings.sensor[i].id.c_str()) == 0) {
|
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"));
|
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);
|
||||||
|
|||||||
@@ -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_) {
|
||||||
|
|||||||
Reference in New Issue
Block a user