perf: replace global buffer with MQTT config URL storage

This commit is contained in:
Yurii committed 2026-10-25 04:50:43 +03:00
1 parent 353452784f
commit 0439b6f7c4
2 files changed
+3 -4

No files matched your search

+3 -2
View File
@@ -79,6 +79,7 @@ protected:
MqttClient* client = nullptr; MqttClient* client = nullptr;
HaHelper* haHelper = nullptr; HaHelper* haHelper = nullptr;
MqttWriter* writer = nullptr; MqttWriter* writer = nullptr;
char configUrl[64] = {};
UnitSystem currentUnitSystem = UnitSystem::METRIC; UnitSystem currentUnitSystem = UnitSystem::METRIC;
bool currentHomeAssistantDiscovery = false; bool currentHomeAssistantDiscovery = false;
std::unordered_map<uint8_t, Sensors::Settings> queueReconfigureSensors; std::unordered_map<uint8_t, Sensors::Settings> queueReconfigureSensors;
@@ -148,8 +149,8 @@ protected:
this->haHelper->setDeviceName(PROJECT_NAME); this->haHelper->setDeviceName(PROJECT_NAME);
this->haHelper->setWriter(this->writer); this->haHelper->setWriter(this->writer);
sprintf(buffer, CONFIG_URL, WiFi.localIP().toString().c_str()); snprintf(this->configUrl, sizeof(this->configUrl), CONFIG_URL, WiFi.localIP().toString().c_str());
this->haHelper->setDeviceConfigUrl(buffer); this->haHelper->setDeviceConfigUrl(this->configUrl);
} }
void loop() { void loop() {
-2
View File
@@ -160,5 +160,3 @@ enum class ChannelDisablingAction : uint8_t {
ZERO_SETPOINT = 1, ZERO_SETPOINT = 1,
OFF_AND_ZERO_SETPOINT = 2 OFF_AND_ZERO_SETPOINT = 2
}; };
char buffer[255];