mirror of
https://github.com/esphome/esphome.git
synced 2025-10-29 22:24:26 +00:00
Reduce entity memory usage by eliminating field shadowing and bit-packing (#9076)
This commit is contained in:
@@ -7,7 +7,7 @@ namespace number {
|
||||
static const char *const TAG = "number";
|
||||
|
||||
void Number::publish_state(float state) {
|
||||
this->has_state_ = true;
|
||||
this->set_has_state(true);
|
||||
this->state = state;
|
||||
ESP_LOGD(TAG, "'%s': Sending state %f", this->get_name().c_str(), state);
|
||||
this->state_callback_.call(state);
|
||||
|
||||
@@ -48,9 +48,6 @@ class Number : public EntityBase {
|
||||
|
||||
NumberTraits traits;
|
||||
|
||||
/// Return whether this number has gotten a full state yet.
|
||||
bool has_state() const { return has_state_; }
|
||||
|
||||
protected:
|
||||
friend class NumberCall;
|
||||
|
||||
@@ -63,7 +60,6 @@ class Number : public EntityBase {
|
||||
virtual void control(float value) = 0;
|
||||
|
||||
CallbackManager<void(float)> state_callback_;
|
||||
bool has_state_{false};
|
||||
};
|
||||
|
||||
} // namespace number
|
||||
|
||||
Reference in New Issue
Block a user