mirror of
https://github.com/esphome/esphome.git
synced 2026-08-22 22:26:21 +00:00
[modbus_controller] Brace single-statement log bodies to fix -Wempty-body (#18543)
This commit is contained in:
@@ -200,8 +200,9 @@ void ModbusController::update_range_(ModbusCommandItem &cmd) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// A refusal is already logged by the hub; note the affected range for controller-level diagnostics.
|
// A refusal is already logged by the hub; note the affected range for controller-level diagnostics.
|
||||||
if (!cmd.send())
|
if (!cmd.send()) {
|
||||||
ESP_LOGD(TAG, "Poll refused by hub for range 0x%X", cmd.register_address());
|
ESP_LOGD(TAG, "Poll refused by hub for range 0x%X", cmd.register_address());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModbusController::update() {
|
void ModbusController::update() {
|
||||||
@@ -214,8 +215,9 @@ void ModbusController::update() {
|
|||||||
ESP_LOGV(TAG, "Module offline - retrying");
|
ESP_LOGV(TAG, "Module offline - retrying");
|
||||||
this->cmd_non_responses_ = 0; // allow the probe through can_send()
|
this->cmd_non_responses_ = 0; // allow the probe through can_send()
|
||||||
for (auto &cmd : this->polling_command_items_) {
|
for (auto &cmd : this->polling_command_items_) {
|
||||||
if (!cmd.send())
|
if (!cmd.send()) {
|
||||||
ESP_LOGD(TAG, "Probe refused by hub for range 0x%X", cmd.register_address());
|
ESP_LOGD(TAG, "Probe refused by hub for range 0x%X", cmd.register_address());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGV(TAG, "Module offline - skipping update");
|
ESP_LOGV(TAG, "Module offline - skipping update");
|
||||||
|
|||||||
Reference in New Issue
Block a user