tidy up lambda's

This commit is contained in:
Proddy
2024-02-13 20:19:58 +01:00
parent 92a80c3aaf
commit ce3c3e0b3e
17 changed files with 37 additions and 36 deletions

View File

@@ -65,7 +65,7 @@ ESP8266React::ESP8266React(AsyncWebServer * server, FS * fs)
void ESP8266React::begin() { void ESP8266React::begin() {
_networkSettingsService.begin(); _networkSettingsService.begin();
_networkSettingsService.read([this](NetworkSettings & networkSettings) { _networkSettingsService.read([&](NetworkSettings & networkSettings) {
DefaultHeaders & defaultHeaders = DefaultHeaders::Instance(); DefaultHeaders & defaultHeaders = DefaultHeaders::Instance();
if (networkSettings.enableCORS) { if (networkSettings.enableCORS) {
defaultHeaders.addHeader("Access-Control-Allow-Origin", networkSettings.CORSOrigin); defaultHeaders.addHeader("Access-Control-Allow-Origin", networkSettings.CORSOrigin);

View File

@@ -80,7 +80,7 @@ class FSPersistence {
void enableUpdateHandler() { void enableUpdateHandler() {
if (!_updateHandlerId) { if (!_updateHandlerId) {
_updateHandlerId = _statefulService->addUpdateHandler([this] { writeToFS(); }); _updateHandlerId = _statefulService->addUpdateHandler([&] { writeToFS(); });
} }
} }

View File

@@ -8,7 +8,7 @@ FactoryResetService::FactoryResetService(AsyncWebServer * server, FS * fs, Secur
} }
void FactoryResetService::handleRequest(AsyncWebServerRequest * request) { void FactoryResetService::handleRequest(AsyncWebServerRequest * request) {
request->onDisconnect([this]() { factoryReset(); }); request->onDisconnect([this] { factoryReset(); });
request->send(200); request->send(200);
} }

View File

@@ -13,7 +13,7 @@ MqttSettingsService::MqttSettingsService(AsyncWebServer * server, FS * fs, Secur
, _disconnectReason(espMqttClientTypes::DisconnectReason::TCP_DISCONNECTED) , _disconnectReason(espMqttClientTypes::DisconnectReason::TCP_DISCONNECTED)
, _mqttClient(nullptr) { , _mqttClient(nullptr) {
WiFi.onEvent([this](WiFiEvent_t event, WiFiEventInfo_t info) { WiFiEvent(event); }); WiFi.onEvent([this](WiFiEvent_t event, WiFiEventInfo_t info) { WiFiEvent(event); });
addUpdateHandler([this]() { onConfigUpdated(); }, false); addUpdateHandler([this] { onConfigUpdated(); }, false);
} }
MqttSettingsService::~MqttSettingsService() { MqttSettingsService::~MqttSettingsService() {

View File

@@ -37,7 +37,7 @@ void NTPStatus::ntpStatus(AsyncWebServerRequest * request) {
time_t now = time(nullptr); time_t now = time(nullptr);
// only provide enabled/disabled status for now // only provide enabled/disabled status for now
root["status"] = []() { root["status"] = [] {
if (esp_sntp_enabled()) { if (esp_sntp_enabled()) {
if (emsesp::EMSESP::system_.ntp_connected()) { if (emsesp::EMSESP::system_.ntp_connected()) {
return 2; return 2;

View File

@@ -7,7 +7,7 @@ NetworkSettingsService::NetworkSettingsService(AsyncWebServer * server, FS * fs,
, _fsPersistence(NetworkSettings::read, NetworkSettings::update, this, fs, NETWORK_SETTINGS_FILE) , _fsPersistence(NetworkSettings::read, NetworkSettings::update, this, fs, NETWORK_SETTINGS_FILE)
, _lastConnectionAttempt(0) , _lastConnectionAttempt(0)
, _stopping(false) { , _stopping(false) {
addUpdateHandler([this]() { reconfigureWiFiConnection(); }, false); addUpdateHandler([this] { reconfigureWiFiConnection(); }, false);
WiFi.onEvent([this](WiFiEvent_t event, WiFiEventInfo_t info) { WiFiEvent(event, info); }); WiFi.onEvent([this](WiFiEvent_t event, WiFiEventInfo_t info) { WiFiEvent(event, info); });
} }

View File

@@ -84,7 +84,7 @@ void UploadFileService::handleUpload(AsyncWebServerRequest * request, const Stri
Update.setMD5(_md5.data()); Update.setMD5(_md5.data());
_md5.front() = '\0'; _md5.front() = '\0';
} }
request->onDisconnect([this]() { handleEarlyDisconnect(); }); // success, let's make sure we end the update if the client hangs up request->onDisconnect([this] { handleEarlyDisconnect(); }); // success, let's make sure we end the update if the client hangs up
} else { } else {
handleError(request, 507); // failed to begin, send an error response Insufficient Storage handleError(request, 507); // failed to begin, send an error response Insufficient Storage
return; return;

View File

@@ -37,7 +37,7 @@ void AnalogSensor::start() {
Command::add( Command::add(
EMSdevice::DeviceType::ANALOGSENSOR, EMSdevice::DeviceType::ANALOGSENSOR,
F_(setvalue), F_(setvalue),
[this](const char * value, const int8_t id) { return command_setvalue(value, id); }, [&](const char * value, const int8_t id) { return command_setvalue(value, id); },
FL_(setiovalue_cmd), FL_(setiovalue_cmd),
CommandFlag::ADMIN_ONLY); CommandFlag::ADMIN_ONLY);
@@ -48,7 +48,7 @@ void AnalogSensor::start() {
// load settings from the customization file, sorts them and initializes the GPIOs // load settings from the customization file, sorts them and initializes the GPIOs
void AnalogSensor::reload() { void AnalogSensor::reload() {
EMSESP::webSettingsService.read([this](WebSettings & settings) { analog_enabled_ = settings.analog_enabled; }); EMSESP::webSettingsService.read([&](WebSettings & settings) { analog_enabled_ = settings.analog_enabled; });
#if defined(EMSESP_STANDALONE) #if defined(EMSESP_STANDALONE)
analog_enabled_ = true; // for local offline testing analog_enabled_ = true; // for local offline testing
@@ -63,7 +63,7 @@ void AnalogSensor::reload() {
} }
// load the list of analog sensors from the customization service // load the list of analog sensors from the customization service
// and store them locally and then activate them // and store them locally and then activate them
EMSESP::webCustomizationService.read([this](WebCustomization & settings) { EMSESP::webCustomizationService.read([&](WebCustomization & settings) {
auto it = sensors_.begin(); auto it = sensors_.begin();
for (auto & sensor_ : sensors_) { for (auto & sensor_ : sensors_) {
// update existing sensors // update existing sensors

View File

@@ -604,7 +604,7 @@ void EMSESPShell::display_banner() {
println(); println();
// set console name // set console name
EMSESP::esp8266React.getNetworkSettingsService()->read([this](NetworkSettings & networkSettings) { console_hostname_ = networkSettings.hostname.c_str(); }); EMSESP::esp8266React.getNetworkSettingsService()->read([&](NetworkSettings & networkSettings) { console_hostname_ = networkSettings.hostname.c_str(); });
if (console_hostname_.empty()) { if (console_hostname_.empty()) {
console_hostname_ = "ems-esp"; console_hostname_ = "ems-esp";
} }

View File

@@ -1118,7 +1118,7 @@ void Boiler::check_active() {
// check forceheatingoff option // check forceheatingoff option
if (!Helpers::hasValue(forceHeatingOff_, EMS_VALUE_BOOL)) { if (!Helpers::hasValue(forceHeatingOff_, EMS_VALUE_BOOL)) {
EMSESP::webSettingsService.read([this](WebSettings & settings) { forceHeatingOff_ = settings.boiler_heatingoff ? EMS_VALUE_BOOL_ON : 0; }); EMSESP::webSettingsService.read([&](WebSettings & settings) { forceHeatingOff_ = settings.boiler_heatingoff ? EMS_VALUE_BOOL_ON : 0; });
has_update(&forceHeatingOff_); has_update(&forceHeatingOff_);
} }
static uint32_t lastSendHeatingOff = 0; static uint32_t lastSendHeatingOff = 0;

View File

@@ -554,7 +554,7 @@ void Solar::process_SM10Monitor(std::shared_ptr<const Telegram> telegram) {
has_update(solarPumpMod_, solarpumpmod); has_update(solarPumpMod_, solarpumpmod);
if (!Helpers::hasValue(maxFlow_)) { if (!Helpers::hasValue(maxFlow_)) {
EMSESP::webSettingsService.read([this](WebSettings & settings) { maxFlow_ = settings.solar_maxflow; }); EMSESP::webSettingsService.read([&](WebSettings & settings) { maxFlow_ = settings.solar_maxflow; });
has_update(&maxFlow_); has_update(&maxFlow_);
} }
@@ -1047,7 +1047,7 @@ bool Solar::set_SM10MaxFlow(const char * value, const int8_t id) {
return false; return false;
} }
maxFlow_ = (flow * 10); maxFlow_ = (flow * 10);
EMSESP::webSettingsService.update([this](WebSettings & settings) { EMSESP::webSettingsService.update([&](WebSettings & settings) {
settings.solar_maxflow = maxFlow_; settings.solar_maxflow = maxFlow_;
return StateUpdateResult::CHANGED; return StateUpdateResult::CHANGED;
}); });

View File

@@ -20,6 +20,7 @@
#include "emsesp.h" #include "emsesp.h"
#include "version.h" #include "version.h"
#include "emsdevice.h" #include "emsdevice.h"
#include <MqttSettingsService.h>
namespace emsesp { namespace emsesp {
@@ -381,7 +382,7 @@ void Mqtt::start() {
// add the 'publish' command ('call system publish' in console or via API) // add the 'publish' command ('call system publish' in console or via API)
Command::add(EMSdevice::DeviceType::SYSTEM, F_(publish), System::command_publish, FL_(publish_cmd)); Command::add(EMSdevice::DeviceType::SYSTEM, F_(publish), System::command_publish, FL_(publish_cmd));
// create last will topic with the base prefixed. It has to be static because asyncmqttclient destroys the reference // create last will topic with the base prefixed. It has to be static because the client destroys the reference
static char will_topic[MQTT_TOPIC_MAX_SIZE]; static char will_topic[MQTT_TOPIC_MAX_SIZE];
if (!Mqtt::base().empty()) { if (!Mqtt::base().empty()) {
snprintf(will_topic, MQTT_TOPIC_MAX_SIZE, "%s/status", Mqtt::base().c_str()); snprintf(will_topic, MQTT_TOPIC_MAX_SIZE, "%s/status", Mqtt::base().c_str());

View File

@@ -25,7 +25,7 @@ uuid::log::Logger Shower::logger_{F_(shower), uuid::log::Facility::CONSOLE};
static bool force_coldshot = false; static bool force_coldshot = false;
void Shower::start() { void Shower::start() {
EMSESP::webSettingsService.read([this](WebSettings & settings) { EMSESP::webSettingsService.read([&](WebSettings & settings) {
shower_timer_ = settings.shower_timer; shower_timer_ = settings.shower_timer;
shower_alert_ = settings.shower_alert; shower_alert_ = settings.shower_alert;
shower_alert_trigger_ = settings.shower_alert_trigger * 60000; // convert from minutes shower_alert_trigger_ = settings.shower_alert_trigger * 60000; // convert from minutes
@@ -35,7 +35,7 @@ void Shower::start() {
Command::add( Command::add(
EMSdevice::DeviceType::BOILER, EMSdevice::DeviceType::BOILER,
F_(coldshot), F_(coldshot),
[this](const char * value, const int8_t id, JsonObject output) { [&](const char * value, const int8_t id, JsonObject output) {
LOG_INFO("Forcing coldshot..."); LOG_INFO("Forcing coldshot...");
if (shower_state_) { if (shower_state_) {
output["message"] = "OK"; output["message"] = "OK";

View File

@@ -202,7 +202,7 @@ bool System::command_syslog_level(const char * value, const int8_t id) {
if (Helpers::value2enum(value, s, FL_(list_syslog_level))) { if (Helpers::value2enum(value, s, FL_(list_syslog_level))) {
bool changed = false; bool changed = false;
EMSESP::webSettingsService.update( EMSESP::webSettingsService.update(
[this](WebSettings & settings) { [&](WebSettings & settings) {
if (settings.syslog_level != (int8_t)s - 1) { if (settings.syslog_level != (int8_t)s - 1) {
settings.syslog_level = (int8_t)s - 1; settings.syslog_level = (int8_t)s - 1;
changed = true; changed = true;
@@ -295,7 +295,7 @@ void System::format(uuid::console::Shell & shell) {
} }
void System::syslog_init() { void System::syslog_init() {
EMSESP::webSettingsService.read([this](WebSettings & settings) { EMSESP::webSettingsService.read([&](WebSettings & settings) {
syslog_enabled_ = settings.syslog_enabled; syslog_enabled_ = settings.syslog_enabled;
syslog_level_ = settings.syslog_level; syslog_level_ = settings.syslog_level;
syslog_mark_interval_ = settings.syslog_mark_interval; syslog_mark_interval_ = settings.syslog_mark_interval;
@@ -349,7 +349,7 @@ void System::syslog_init() {
// read some specific system settings to store locally for faster access // read some specific system settings to store locally for faster access
void System::reload_settings() { void System::reload_settings() {
EMSESP::webSettingsService.read([this](WebSettings & settings) { EMSESP::webSettingsService.read([&](WebSettings & settings) {
version_ = settings.version; version_ = settings.version;
pbutton_gpio_ = settings.pbutton_gpio; pbutton_gpio_ = settings.pbutton_gpio;
@@ -427,7 +427,7 @@ void System::start() {
refreshHeapMem(); // refresh free heap and max alloc heap refreshHeapMem(); // refresh free heap and max alloc heap
#endif #endif
EMSESP::esp8266React.getNetworkSettingsService()->read([this](NetworkSettings & networkSettings) { EMSESP::esp8266React.getNetworkSettingsService()->read([&](NetworkSettings & networkSettings) {
hostname(networkSettings.hostname.c_str()); // sets the hostname hostname(networkSettings.hostname.c_str()); // sets the hostname
}); });
@@ -1104,14 +1104,14 @@ bool System::check_upgrade(bool factory_settings) {
// if we're coming from 3.4.4 or 3.5.0b14 which had no version stored then we need to apply new settings // if we're coming from 3.4.4 or 3.5.0b14 which had no version stored then we need to apply new settings
if (missing_version) { if (missing_version) {
LOG_INFO("Setting MQTT Entity ID format to v3.4 format"); LOG_INFO("Setting MQTT Entity ID format to v3.4 format");
EMSESP::esp8266React.getMqttSettingsService()->update([this](MqttSettings & mqttSettings) { EMSESP::esp8266React.getMqttSettingsService()->update([&](MqttSettings & mqttSettings) {
mqttSettings.entity_format = 0; // use old Entity ID format from v3.4 mqttSettings.entity_format = 0; // use old Entity ID format from v3.4
return StateUpdateResult::CHANGED; return StateUpdateResult::CHANGED;
}); });
} }
// Network Settings Wifi tx_power is now using the value * 4. // Network Settings Wifi tx_power is now using the value * 4.
EMSESP::esp8266React.getNetworkSettingsService()->update([this](NetworkSettings & networkSettings) { EMSESP::esp8266React.getNetworkSettingsService()->update([&](NetworkSettings & networkSettings) {
if (networkSettings.tx_power == 20) { if (networkSettings.tx_power == 20) {
networkSettings.tx_power = WIFI_POWER_19_5dBm; // use 19.5 as we don't have 20 anymore networkSettings.tx_power = WIFI_POWER_19_5dBm; // use 19.5 as we don't have 20 anymore
LOG_INFO("Setting WiFi TX Power to Auto"); LOG_INFO("Setting WiFi TX Power to Auto");
@@ -1130,7 +1130,7 @@ bool System::check_upgrade(bool factory_settings) {
// if we did a change, set the new version and reboot // if we did a change, set the new version and reboot
if (save_version) { if (save_version) {
EMSESP::webSettingsService.update([this](WebSettings & settings) { EMSESP::webSettingsService.update([&](WebSettings & settings) {
settings.version = EMSESP_APP_VERSION; settings.version = EMSESP_APP_VERSION;
return StateUpdateResult::CHANGED; return StateUpdateResult::CHANGED;
}); });

View File

@@ -243,7 +243,7 @@ void RxService::add_empty(const uint8_t src, const uint8_t dest, const uint16_t
// send out request to EMS bus for all devices // send out request to EMS bus for all devices
void TxService::start() { void TxService::start() {
// grab the bus ID and tx_mode // grab the bus ID and tx_mode
EMSESP::webSettingsService.read([this](WebSettings & settings) { EMSESP::webSettingsService.read([&](WebSettings & settings) {
ems_bus_id(settings.ems_bus_id); ems_bus_id(settings.ems_bus_id);
tx_mode(settings.tx_mode); tx_mode(settings.tx_mode);
}); });

View File

@@ -53,7 +53,7 @@ void TemperatureSensor::start() {
// load settings // load settings
void TemperatureSensor::reload() { void TemperatureSensor::reload() {
// load the service settings // load the service settings
EMSESP::webSettingsService.read([this](WebSettings & settings) { EMSESP::webSettingsService.read([&](WebSettings & settings) {
dallas_gpio_ = settings.dallas_gpio; dallas_gpio_ = settings.dallas_gpio;
parasite_ = settings.dallas_parasite; parasite_ = settings.dallas_parasite;
}); });
@@ -604,7 +604,7 @@ std::string TemperatureSensor::Sensor::name() const {
// look up in customization service for a specific sensor // look up in customization service for a specific sensor
// and set the name and offset from that entry if it exists // and set the name and offset from that entry if it exists
bool TemperatureSensor::Sensor::apply_customization() { bool TemperatureSensor::Sensor::apply_customization() {
EMSESP::webCustomizationService.read([this](WebCustomization & settings) { EMSESP::webCustomizationService.read([&](WebCustomization & settings) {
auto sensors = settings.sensorCustomizations; auto sensors = settings.sensorCustomizations;
if (!sensors.empty()) { if (!sensors.empty()) {
for (const auto & sensor : sensors) { for (const auto & sensor : sensors) {

View File

@@ -128,7 +128,7 @@ StateUpdateResult WebCustomEntity::update(JsonObject root, WebCustomEntity & web
// set value by api command // set value by api command
bool WebCustomEntityService::command_setvalue(const char * value, const std::string name) { bool WebCustomEntityService::command_setvalue(const char * value, const std::string name) {
EMSESP::webCustomEntityService.read([this](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; }); EMSESP::webCustomEntityService.read([&](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; });
for (CustomEntityItem & entityItem : *customEntityItems) { for (CustomEntityItem & entityItem : *customEntityItems) {
if (Helpers::toLower(entityItem.name) == Helpers::toLower(name)) { if (Helpers::toLower(entityItem.name) == Helpers::toLower(name)) {
if (entityItem.ram == 1) { if (entityItem.ram == 1) {
@@ -251,7 +251,7 @@ void WebCustomEntityService::show_values(JsonObject output) {
// process json output for info/commands and value_info // process json output for info/commands and value_info
bool WebCustomEntityService::get_value_info(JsonObject output, const char * cmd) { bool WebCustomEntityService::get_value_info(JsonObject output, const char * cmd) {
EMSESP::webCustomEntityService.read([this](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; }); EMSESP::webCustomEntityService.read([&](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; });
// if it's commands... // if it's commands...
if (Helpers::toLower(cmd) == F_(commands)) { if (Helpers::toLower(cmd) == F_(commands)) {
@@ -365,7 +365,7 @@ void WebCustomEntityService::publish(const bool force) {
return; return;
} }
EMSESP::webCustomEntityService.read([this](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; }); EMSESP::webCustomEntityService.read([&](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; });
if (customEntityItems->size() == 0) { if (customEntityItems->size() == 0) {
return; return;
} }
@@ -456,7 +456,7 @@ void WebCustomEntityService::publish(const bool force) {
// count only entities with valid value or command to show in dashboard // count only entities with valid value or command to show in dashboard
uint8_t WebCustomEntityService::count_entities() { uint8_t WebCustomEntityService::count_entities() {
EMSESP::webCustomEntityService.read([this](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; }); EMSESP::webCustomEntityService.read([&](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; });
if (customEntityItems->size() == 0) { if (customEntityItems->size() == 0) {
return 0; return 0;
} }
@@ -473,7 +473,7 @@ uint8_t WebCustomEntityService::count_entities() {
} }
uint8_t WebCustomEntityService::has_commands() { uint8_t WebCustomEntityService::has_commands() {
EMSESP::webCustomEntityService.read([this](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; }); EMSESP::webCustomEntityService.read([&](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; });
uint8_t count = 0; uint8_t count = 0;
for (const CustomEntityItem & entity : *customEntityItems) { for (const CustomEntityItem & entity : *customEntityItems) {
count += entity.writeable ? 1 : 0; count += entity.writeable ? 1 : 0;
@@ -484,7 +484,7 @@ uint8_t WebCustomEntityService::has_commands() {
// send to dashboard, msgpack don't like serialized, use number // send to dashboard, msgpack don't like serialized, use number
void WebCustomEntityService::generate_value_web(JsonObject output) { void WebCustomEntityService::generate_value_web(JsonObject output) {
EMSESP::webCustomEntityService.read([this](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; }); EMSESP::webCustomEntityService.read([&](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; });
output["label"] = (std::string) "Custom Entities"; output["label"] = (std::string) "Custom Entities";
JsonArray data = output["data"].to<JsonArray>(); JsonArray data = output["data"].to<JsonArray>();
@@ -556,7 +556,7 @@ void WebCustomEntityService::generate_value_web(JsonObject output) {
// fetch telegram, called from emsesp::fetch // fetch telegram, called from emsesp::fetch
void WebCustomEntityService::fetch() { void WebCustomEntityService::fetch() {
EMSESP::webCustomEntityService.read([this](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; }); EMSESP::webCustomEntityService.read([&](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; });
const uint8_t len[] = {1, 1, 1, 2, 2, 3, 3}; const uint8_t len[] = {1, 1, 1, 2, 2, 3, 3};
for (auto & entity : *customEntityItems) { for (auto & entity : *customEntityItems) {
@@ -582,7 +582,7 @@ void WebCustomEntityService::fetch() {
// called on process telegram, read from telegram // called on process telegram, read from telegram
bool WebCustomEntityService::get_value(std::shared_ptr<const Telegram> telegram) { bool WebCustomEntityService::get_value(std::shared_ptr<const Telegram> telegram) {
bool has_change = false; bool has_change = false;
EMSESP::webCustomEntityService.read([this](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; }); EMSESP::webCustomEntityService.read([&](WebCustomEntity & webEntity) { customEntityItems = &webEntity.customEntityItems; });
// read-length of BOOL, INT, UINT, SHORT, USHORT, ULONG, TIME // read-length of BOOL, INT, UINT, SHORT, USHORT, ULONG, TIME
const uint8_t len[] = {1, 1, 1, 2, 2, 3, 3}; const uint8_t len[] = {1, 1, 1, 2, 2, 3, 3};
for (auto & entity : *customEntityItems) { for (auto & entity : *customEntityItems) {
@@ -626,7 +626,7 @@ bool WebCustomEntityService::get_value(std::shared_ptr<const Telegram> telegram)
// hard coded tests // hard coded tests
#ifdef EMSESP_TEST #ifdef EMSESP_TEST
void WebCustomEntityService::test() { void WebCustomEntityService::test() {
update([this](WebCustomEntity & webCustomEntity) { update([&](WebCustomEntity & webCustomEntity) {
webCustomEntity.customEntityItems.clear(); webCustomEntity.customEntityItems.clear();
// test 1 // test 1
auto entityItem = CustomEntityItem(); auto entityItem = CustomEntityItem();