mirror of
https://github.com/esphome/esphome.git
synced 2026-10-03 09:46:03 +00:00
[modbus] Fix parsing & split out server mode (#11969)
This commit is contained in:
@@ -201,7 +201,7 @@ void ModbusController::update() {
|
||||
// walk through the sensors and determine the register ranges to read
|
||||
size_t ModbusController::create_register_ranges_() {
|
||||
this->register_ranges_.clear();
|
||||
if (this->parent_->role == modbus::ModbusRole::CLIENT && this->sensorset_.empty()) {
|
||||
if (this->sensorset_.empty()) {
|
||||
ESP_LOGW(TAG, "No sensors registered");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ class ModbusCommandItem {
|
||||
* Responses for the commands are dispatched to the modbus sensor items.
|
||||
*/
|
||||
|
||||
class ModbusController : public PollingComponent, public modbus::ModbusDevice {
|
||||
class ModbusController : public PollingComponent, public modbus::ModbusClientDevice {
|
||||
public:
|
||||
void dump_config() override;
|
||||
void loop() override;
|
||||
|
||||
Reference in New Issue
Block a user