mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-11-11 08:54:51 +05:00
perf: replace global buffer with MQTT config URL storage
This commit is contained in:
1 parent
353452784f
commit
0439b6f7c4
2 files changed
+3
-4
No files matched your search
+3
-2
@@ -79,6 +79,7 @@ protected:
|
||||
MqttClient* client = nullptr;
|
||||
HaHelper* haHelper = nullptr;
|
||||
MqttWriter* writer = nullptr;
|
||||
char configUrl[64] = {};
|
||||
UnitSystem currentUnitSystem = UnitSystem::METRIC;
|
||||
bool currentHomeAssistantDiscovery = false;
|
||||
std::unordered_map<uint8_t, Sensors::Settings> queueReconfigureSensors;
|
||||
@@ -148,8 +149,8 @@ protected:
|
||||
this->haHelper->setDeviceName(PROJECT_NAME);
|
||||
this->haHelper->setWriter(this->writer);
|
||||
|
||||
sprintf(buffer, CONFIG_URL, WiFi.localIP().toString().c_str());
|
||||
this->haHelper->setDeviceConfigUrl(buffer);
|
||||
snprintf(this->configUrl, sizeof(this->configUrl), CONFIG_URL, WiFi.localIP().toString().c_str());
|
||||
this->haHelper->setDeviceConfigUrl(this->configUrl);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@@ -160,5 +160,3 @@ enum class ChannelDisablingAction : uint8_t {
|
||||
ZERO_SETPOINT = 1,
|
||||
OFF_AND_ZERO_SETPOINT = 2
|
||||
};
|
||||
|
||||
char buffer[255];
|
||||
Reference in new issue
Block a user