mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-28 16:07:16 +02:00
Add local configuration to set http domain
change http domain by PUT from local server request
This commit is contained in:
@ -944,6 +944,12 @@ void initializeNetwork() {
|
||||
agSerial->setDebug(true);
|
||||
}
|
||||
|
||||
String httpDomain = configuration.getHttpDomain();
|
||||
if (httpDomain != "") {
|
||||
agClient->setHttpDomain(httpDomain.c_str());
|
||||
Serial.printf("HTTP request domain set to: %s\n", httpDomain.c_str());
|
||||
}
|
||||
|
||||
if (!agClient->begin(ag->deviceId().c_str())) {
|
||||
oledDisplay.setText("Client", "initialization", "failed");
|
||||
delay(5000);
|
||||
@ -1041,6 +1047,16 @@ static void configUpdateHandle() {
|
||||
initMqtt();
|
||||
}
|
||||
|
||||
String httpDomain = configuration.getHttpDomain();
|
||||
if (httpDomain != "") {
|
||||
Serial.printf("HTTP request domain set to: %s\n", httpDomain.c_str());
|
||||
agClient->setHttpDomain(httpDomain.c_str());
|
||||
} else {
|
||||
// Its empty, set to default
|
||||
Serial.println("HTTP domain from configuration empty, set to default");
|
||||
agClient->setHttpDomainDefault();
|
||||
}
|
||||
|
||||
if (configuration.hasSensorSGP) {
|
||||
if (configuration.noxLearnOffsetChanged() ||
|
||||
configuration.tvocLearnOffsetChanged()) {
|
||||
|
Reference in New Issue
Block a user