mirror of
https://github.com/esphome/esphome.git
synced 2026-02-06 01:22:47 +08:00
_strtod_l
This commit is contained in:
@@ -331,7 +331,7 @@ void ESPHomeOTAComponent::handle_data_() {
|
||||
if (now - last_progress > 1000) {
|
||||
last_progress = now;
|
||||
float percentage = (total * 100.0f) / ota_size;
|
||||
ESP_LOGD(TAG, "Progress: %0.1f%%", percentage);
|
||||
ESP_LOGD(TAG, "Progress: %s%d.%d%%", DECIMAL_1(percentage));
|
||||
#ifdef USE_OTA_STATE_LISTENER
|
||||
this->notify_state_(ota::OTA_IN_PROGRESS, percentage, 0);
|
||||
#endif
|
||||
|
||||
@@ -169,14 +169,14 @@ uint8_t OtaHttpRequestComponent::do_ota_() {
|
||||
if ((now - last_progress > 1000) or (container->get_bytes_read() == container->content_length)) {
|
||||
last_progress = now;
|
||||
float percentage = container->get_bytes_read() * 100.0f / container->content_length;
|
||||
ESP_LOGD(TAG, "Progress: %0.1f%%", percentage);
|
||||
ESP_LOGD(TAG, "Progress: %s%d.%d%%", DECIMAL_1(percentage));
|
||||
#ifdef USE_OTA_STATE_LISTENER
|
||||
this->notify_state_(ota::OTA_IN_PROGRESS, percentage, 0);
|
||||
#endif
|
||||
}
|
||||
} // while
|
||||
|
||||
ESP_LOGI(TAG, "Done in %.0f seconds", float(millis() - update_start_time) / 1000);
|
||||
ESP_LOGI(TAG, "Done in %d seconds", (int) (float(millis() - update_start_time) / 1000));
|
||||
|
||||
// verify MD5 is as expected and act accordingly
|
||||
md5_receive.calculate();
|
||||
|
||||
@@ -66,7 +66,7 @@ void Sensor::publish_state(float state) {
|
||||
this->raw_state = state;
|
||||
this->raw_callback_.call(state);
|
||||
|
||||
ESP_LOGV(TAG, "'%s': Received new state %f", this->name_.c_str(), state);
|
||||
ESP_LOGV(TAG, "'%s': Received new state %s%d.%02d", this->name_.c_str(), DECIMAL_2(state));
|
||||
|
||||
if (this->filter_list_ == nullptr) {
|
||||
this->internal_send_state_to_frontend(state);
|
||||
|
||||
@@ -84,7 +84,7 @@ void OTARequestHandler::report_ota_progress_(AsyncWebServerRequest *request) {
|
||||
// access to the actual firmware size until the upload is complete. This is intentional
|
||||
// as it still gives the user a reasonable progress indication.
|
||||
percentage = (this->ota_read_length_ * 100.0f) / request->contentLength();
|
||||
ESP_LOGD(TAG, "OTA in progress: %0.1f%%", percentage);
|
||||
ESP_LOGD(TAG, "OTA in progress: %s%d.%d%%", DECIMAL_1(percentage));
|
||||
} else {
|
||||
ESP_LOGD(TAG, "OTA in progress: %" PRIu32 " bytes read", this->ota_read_length_);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user