mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 13:46:36 +00:00
Reduce log messages during web update #300
This commit is contained in:
parent
d4be43588f
commit
8d2b27509d
@ -222,12 +222,17 @@ void otaEverySecond(void)
|
|||||||
#endif // HASP_USE_OTA
|
#endif // HASP_USE_OTA
|
||||||
|
|
||||||
#if HASP_USE_HTTP_UPDATE > 0
|
#if HASP_USE_HTTP_UPDATE > 0
|
||||||
|
static unsigned long htppLastLoopTime = 0;
|
||||||
|
|
||||||
static void ota_on_http_progress(unsigned int progress, unsigned int total)
|
static void ota_on_http_progress(unsigned int progress, unsigned int total)
|
||||||
{
|
{
|
||||||
if(total == 0) return;
|
if(total == 0) return;
|
||||||
otaPrecentageComplete = progress * 100 / total;
|
otaPrecentageComplete = progress * 100 / total;
|
||||||
haspProgressVal(otaPrecentageComplete);
|
haspProgressVal(otaPrecentageComplete);
|
||||||
|
|
||||||
|
if(millis() - htppLastLoopTime < 1250) return;
|
||||||
LOG_VERBOSE(TAG_OTA, F(D_OTA_UPDATING_FIRMWARE " %d%%"), otaPrecentageComplete);
|
LOG_VERBOSE(TAG_OTA, F(D_OTA_UPDATING_FIRMWARE " %d%%"), otaPrecentageComplete);
|
||||||
|
htppLastLoopTime = millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ota_on_http_end(void)
|
static void ota_on_http_end(void)
|
||||||
@ -286,7 +291,7 @@ void ota_http_update(const char* espOtaUrl)
|
|||||||
secureClient.setCACertBundle(rootca_crt_bundle_start);
|
secureClient.setCACertBundle(rootca_crt_bundle_start);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
returnCode = httpUpdate.update(secureClient, espOtaUrl);
|
returnCode = httpUpdate.update(secureClient, espOtaUrl, haspDevice.get_version());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user