mirror of
https://github.com/esphome/esphome.git
synced 2025-09-16 02:02:21 +01:00
Force braces around multi-line statements (#3094)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -139,10 +139,11 @@ void RC522::loop() {
|
||||
|
||||
StatusCode status = STATUS_ERROR; // For lint passing. TODO: refactor this
|
||||
if (awaiting_comm_) {
|
||||
if (state_ == STATE_SELECT_SERIAL_DONE)
|
||||
if (state_ == STATE_SELECT_SERIAL_DONE) {
|
||||
status = await_crc_();
|
||||
else
|
||||
} else {
|
||||
status = await_transceive_();
|
||||
}
|
||||
|
||||
if (status == STATUS_WAITING) {
|
||||
return;
|
||||
@@ -210,11 +211,12 @@ void RC522::loop() {
|
||||
}
|
||||
case STATE_READ_SERIAL_DONE: {
|
||||
if (status != STATUS_OK || back_length_ != 3) {
|
||||
if (status == STATUS_TIMEOUT)
|
||||
if (status == STATUS_TIMEOUT) {
|
||||
ESP_LOGV(TAG, "STATE_READ_SERIAL_DONE -> TIMEOUT (no tag present) %d", status);
|
||||
else
|
||||
} else {
|
||||
ESP_LOGW(TAG, "Unexpected response. Read status is %d. Read bytes: %d (%s)", status, back_length_,
|
||||
format_buffer(buffer_, 9).c_str());
|
||||
}
|
||||
|
||||
state_ = STATE_DONE;
|
||||
uid_idx_ = 0;
|
||||
@@ -476,9 +478,9 @@ RC522::StatusCode RC522::await_crc_() {
|
||||
|
||||
bool RC522BinarySensor::process(std::vector<uint8_t> &data) {
|
||||
bool result = true;
|
||||
if (data.size() != this->uid_.size())
|
||||
if (data.size() != this->uid_.size()) {
|
||||
result = false;
|
||||
else {
|
||||
} else {
|
||||
for (size_t i = 0; i < data.size(); i++) {
|
||||
if (data[i] != this->uid_[i]) {
|
||||
result = false;
|
||||
|
Reference in New Issue
Block a user