mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 12:46:22 +01:00
Fix clang-tidy
This commit is contained in:
parent
4cec5d8351
commit
734c2d6bbc
@ -196,8 +196,7 @@ void ESP32ImprovComponent::set_state_(improv::State state) {
|
|||||||
ESP_LOGV(TAG, "Setting state: %d", state);
|
ESP_LOGV(TAG, "Setting state: %d", state);
|
||||||
this->state_ = state;
|
this->state_ = state;
|
||||||
if (this->status_->get_value().empty() || this->status_->get_value()[0] != state) {
|
if (this->status_->get_value().empty() || this->status_->get_value()[0] != state) {
|
||||||
uint8_t data[1]{state};
|
this->status_->set_value(ByteBuffer::wrap(static_cast<uint8_t>(state)));
|
||||||
this->status_->set_value(ByteBuffer::wrap(data));
|
|
||||||
if (state != improv::STATE_STOPPED)
|
if (state != improv::STATE_STOPPED)
|
||||||
this->status_->notify();
|
this->status_->notify();
|
||||||
}
|
}
|
||||||
@ -226,8 +225,7 @@ void ESP32ImprovComponent::set_error_(improv::Error error) {
|
|||||||
ESP_LOGE(TAG, "Error: %d", error);
|
ESP_LOGE(TAG, "Error: %d", error);
|
||||||
}
|
}
|
||||||
if (this->error_->get_value().empty() || this->error_->get_value()[0] != error) {
|
if (this->error_->get_value().empty() || this->error_->get_value()[0] != error) {
|
||||||
uint8_t data[1]{error};
|
this->error_->set_value(ByteBuffer::wrap(static_cast<uint8_t>(error)));
|
||||||
this->error_->set_value(ByteBuffer::wrap(data));
|
|
||||||
if (this->state_ != improv::STATE_STOPPED)
|
if (this->state_ != improv::STATE_STOPPED)
|
||||||
this->error_->notify();
|
this->error_->notify();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user