mirror of
https://github.com/esphome/esphome.git
synced 2025-09-17 18:52:19 +01:00
Optimize Component and Application state storage from uint32_t to uint8_t (#9082)
This commit is contained in:
@@ -19,9 +19,8 @@ void KMeterISOComponent::setup() {
|
||||
|
||||
// Mark as not failed before initializing. Some devices will turn off sensors to save on batteries
|
||||
// and when they come back on, the COMPONENT_STATE_FAILED bit must be unset on the component.
|
||||
if ((this->component_state_ & COMPONENT_STATE_MASK) == COMPONENT_STATE_FAILED) {
|
||||
this->component_state_ &= ~COMPONENT_STATE_MASK;
|
||||
this->component_state_ |= COMPONENT_STATE_CONSTRUCTION;
|
||||
if (this->is_failed()) {
|
||||
this->reset_to_construction_state();
|
||||
}
|
||||
|
||||
auto err = this->bus_->writev(this->address_, nullptr, 0);
|
||||
|
Reference in New Issue
Block a user