mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
[uptime] Pass known length to publish_state to avoid redundant strlen
This commit is contained in:
@@ -70,7 +70,7 @@ void UptimeTextSensor::update() {
|
||||
if (show_seconds)
|
||||
append_unit(buf, sizeof(buf), pos, this->separator_, seconds, this->seconds_text_);
|
||||
|
||||
this->publish_state(buf);
|
||||
this->publish_state(buf, pos);
|
||||
}
|
||||
|
||||
float UptimeTextSensor::get_setup_priority() const { return setup_priority::HARDWARE; }
|
||||
|
||||
Reference in New Issue
Block a user