1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-18 07:45:56 +00:00

Support ESP8266 Arduino 3.0.0 (#1897)

Co-authored-by: Otto Winter <otto@otto-winter.com>
This commit is contained in:
Stefan Agner
2021-06-15 08:50:58 +02:00
committed by GitHub
parent 92bbedfa5a
commit a80f9ed336
4 changed files with 17 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ std::string truncate_string(const std::string &s, size_t length) {
}
std::string value_accuracy_to_string(float value, int8_t accuracy_decimals) {
auto multiplier = float(pow10(accuracy_decimals));
auto multiplier = float(powf(10.0f, accuracy_decimals));
float value_rounded = roundf(value * multiplier) / multiplier;
char tmp[32]; // should be enough, but we should maybe improve this at some point.
dtostrf(value_rounded, 0, uint8_t(std::max(0, int(accuracy_decimals))), tmp);