mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-16 02:02:11 +02:00
Implement regular OTA update attempt / indicate OTA processing on display
This commit is contained in:
@ -82,7 +82,7 @@ static WifiConnector wifiConnector(oledDisplay, Serial, stateMachine,
|
||||
configuration);
|
||||
static OpenMetrics openMetrics(measurements, configuration, wifiConnector,
|
||||
apiClient);
|
||||
static OtaHandler otaHandler;
|
||||
static OtaHandler otaHandler(stateMachine, configuration);
|
||||
static LocalServer localServer(Serial, openMetrics, measurements, configuration,
|
||||
wifiConnector);
|
||||
|
||||
@ -157,6 +157,7 @@ void setup() {
|
||||
apiClient.setAirGradient(ag);
|
||||
openMetrics.setAirGradient(ag);
|
||||
localServer.setAirGraident(ag);
|
||||
otaHandler.setAirGradient(ag);
|
||||
|
||||
/** Connecting wifi */
|
||||
bool connectToWifi = false;
|
||||
@ -184,7 +185,7 @@ void setup() {
|
||||
#ifdef ESP8266
|
||||
// ota not supported
|
||||
#else
|
||||
otaHandler.updateFirmwareIfOutdated(ag->deviceId());
|
||||
// otaHandler.updateFirmwareIfOutdated(ag->deviceId());
|
||||
#endif
|
||||
|
||||
apiClient.fetchServerConfiguration();
|
||||
@ -733,6 +734,11 @@ static void configUpdateHandle() {
|
||||
String(configuration.getDisplayBrightness()));
|
||||
}
|
||||
|
||||
String newVer = configuration.newFirmwareVersion();
|
||||
if (newVer.length()) {
|
||||
otaHandler.updateFirmwareIfOutdated(newVer);
|
||||
}
|
||||
|
||||
appDispHandler();
|
||||
appLedHandler();
|
||||
}
|
||||
|
Reference in New Issue
Block a user