mirror of
https://github.com/esphome/esphome.git
synced 2025-10-25 13:13:48 +01:00
[web_server] Reduce flash and RAM usage by optimizing string construction (#10986)
This commit is contained in:
@@ -45,6 +45,9 @@
|
||||
|
||||
namespace esphome {
|
||||
|
||||
// Forward declaration to avoid circular dependency with string_ref.h
|
||||
class StringRef;
|
||||
|
||||
/// @name STL backports
|
||||
///@{
|
||||
|
||||
@@ -610,6 +613,8 @@ ParseOnOffState parse_on_off(const char *str, const char *on = nullptr, const ch
|
||||
|
||||
/// Create a string from a value and an accuracy in decimals.
|
||||
std::string value_accuracy_to_string(float value, int8_t accuracy_decimals);
|
||||
/// Create a string from a value, an accuracy in decimals, and a unit of measurement.
|
||||
std::string value_accuracy_with_uom_to_string(float value, int8_t accuracy_decimals, StringRef unit_of_measurement);
|
||||
|
||||
/// Derive accuracy in decimals from an increment step.
|
||||
int8_t step_to_accuracy_decimals(float step);
|
||||
|
||||
Reference in New Issue
Block a user