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,9 +200,10 @@ void ModbusController::update_range_(ModbusCommandItem &cmd) {
|
||||
return;
|
||||
}
|
||||
// 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());
|
||||
}
|
||||
}
|
||||
|
||||
void ModbusController::update() {
|
||||
this->sweep_completed_one_shots_(); // reclaim one-shots deferred out of their own callbacks
|
||||
@@ -214,9 +215,10 @@ void ModbusController::update() {
|
||||
ESP_LOGV(TAG, "Module offline - retrying");
|
||||
this->cmd_non_responses_ = 0; // allow the probe through can_send()
|
||||
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());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ESP_LOGV(TAG, "Module offline - skipping update");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user