Modbus: use multiply for publishing number (#2916)

This commit is contained in:
Martin 2021-12-15 10:38:23 +01:00 committed by GitHub
parent 192eb49589
commit 1fb0a7109d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@ namespace modbus_controller {
static const char *const TAG = "modbus.number"; static const char *const TAG = "modbus.number";
void ModbusNumber::parse_and_publish(const std::vector<uint8_t> &data) { void ModbusNumber::parse_and_publish(const std::vector<uint8_t> &data) {
float result = payload_to_float(data, *this); float result = payload_to_float(data, *this) / multiply_by_;
// Is there a lambda registered // Is there a lambda registered
// call it with the pre converted value and the raw data array // call it with the pre converted value and the raw data array