mirror of
https://github.com/esphome/esphome.git
synced 2024-11-24 12:06:26 +01:00
Fix format.
This commit is contained in:
parent
3fded02679
commit
f77572c62e
@ -134,8 +134,8 @@ void SPS30Component::update() {
|
||||
|
||||
// If its not time to take an action, do nothing.
|
||||
if (millis() < this->next_state_ms_) {
|
||||
ESP_LOGD(TAG, "Sensor waiting for %ums before transitioning to state %d.",
|
||||
(this->next_state_ms_ - millis()), this->next_state_);
|
||||
ESP_LOGD(TAG, "Sensor waiting for %ums before transitioning to state %d.", (this->next_state_ms_ - millis()),
|
||||
this->next_state_);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -235,7 +235,7 @@ void SPS30Component::update() {
|
||||
this->skipped_data_read_cycles_ = 0;
|
||||
|
||||
// Idle if we got a reading and our next state is to idle
|
||||
if(this->next_state_ == IDLE && millis() >= this->next_state_ms_) {
|
||||
if (this->next_state_ == IDLE && millis() >= this->next_state_ms_) {
|
||||
this->stop_measurement();
|
||||
this->next_state_ms_ = millis() + this->idle_interval_.value();
|
||||
this->next_state_ = WAKE;
|
||||
|
@ -40,12 +40,7 @@ class SPS30Component : public PollingComponent, public sensirion_common::Sensiri
|
||||
uint8_t skipped_data_read_cycles_ = 0;
|
||||
uint32_t next_state_ms_ = 0;
|
||||
|
||||
enum NextState {
|
||||
IDLE,
|
||||
WAKE,
|
||||
READ,
|
||||
NONE
|
||||
} next_state_{NONE};
|
||||
enum NextState { IDLE, WAKE, READ, NONE } next_state_{NONE};
|
||||
|
||||
enum ErrorCode {
|
||||
COMMUNICATION_FAILED,
|
||||
|
Loading…
Reference in New Issue
Block a user