mirror of
https://github.com/esphome/esphome.git
synced 2025-11-20 08:46:01 +00:00
Reduce entity memory usage by eliminating field shadowing and bit-packing (#9076)
This commit is contained in:
@@ -88,13 +88,12 @@ float Sensor::get_raw_state() const { return this->raw_state; }
|
||||
std::string Sensor::unique_id() { return ""; }
|
||||
|
||||
void Sensor::internal_send_state_to_frontend(float state) {
|
||||
this->has_state_ = true;
|
||||
this->set_has_state(true);
|
||||
this->state = state;
|
||||
ESP_LOGD(TAG, "'%s': Sending state %.5f %s with %d decimals of accuracy", this->get_name().c_str(), state,
|
||||
this->get_unit_of_measurement().c_str(), this->get_accuracy_decimals());
|
||||
this->callback_.call(state);
|
||||
}
|
||||
bool Sensor::has_state() const { return this->has_state_; }
|
||||
|
||||
} // namespace sensor
|
||||
} // namespace esphome
|
||||
|
||||
Reference in New Issue
Block a user