Fix #723: For some reason, a space was added before 1 digit numbers

This commit is contained in:
Thomas Basler 2023-03-20 18:05:43 +01:00
parent 494ae22f45
commit ac73747a29

View File

@ -126,9 +126,12 @@ void MqttHandleInverterClass::publishField(std::shared_ptr<InverterAbstract> inv
return;
}
MqttSettings.publish(topic, String(
String value = String(
inv->Statistics()->getChannelFieldValue(type, channel, fieldId),
static_cast<unsigned int>(inv->Statistics()->getChannelFieldDigits(type, channel, fieldId))));
static_cast<unsigned int>(inv->Statistics()->getChannelFieldDigits(type, channel, fieldId)));
value.trim();
MqttSettings.publish(topic, value);
}
String MqttHandleInverterClass::getTopic(std::shared_ptr<InverterAbstract> inv, ChannelType_t type, ChannelNum_t channel, FieldId_t fieldId)