mirror of
https://github.com/esphome/esphome.git
synced 2025-10-28 13:43:54 +00:00
modbus_controller: bugfix: enable overriding calculated register size (#2845)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -13,7 +13,7 @@ void ModbusTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Modbus Controller Te
|
||||
|
||||
void ModbusTextSensor::parse_and_publish(const std::vector<uint8_t> &data) {
|
||||
std::ostringstream output;
|
||||
uint8_t max_items = this->response_bytes_;
|
||||
uint8_t max_items = this->response_bytes;
|
||||
char buffer[4];
|
||||
bool add_comma = false;
|
||||
for (auto b : data) {
|
||||
|
||||
@@ -17,7 +17,7 @@ class ModbusTextSensor : public Component, public text_sensor::TextSensor, publi
|
||||
this->register_type = register_type;
|
||||
this->start_address = start_address;
|
||||
this->offset = offset;
|
||||
this->response_bytes_ = response_bytes;
|
||||
this->response_bytes = response_bytes;
|
||||
this->register_count = register_count;
|
||||
this->encode_ = encode;
|
||||
this->skip_updates = skip_updates;
|
||||
@@ -38,7 +38,6 @@ class ModbusTextSensor : public Component, public text_sensor::TextSensor, publi
|
||||
|
||||
protected:
|
||||
RawEncoding encode_;
|
||||
uint16_t response_bytes_;
|
||||
};
|
||||
|
||||
} // namespace modbus_controller
|
||||
|
||||
Reference in New Issue
Block a user