merge PR #667 and PR #668

This commit is contained in:
Proddy
2022-10-07 21:11:18 +02:00
parent 5faffc3886
commit 0dde5a9d2b
11 changed files with 106 additions and 114 deletions

View File

@@ -390,7 +390,7 @@ void AnalogSensor::publish_values(const bool force) {
case AnalogType::PWM_0:
case AnalogType::PWM_1:
case AnalogType::PWM_2:
dataSensor["value"] = sensor.value(); // float
dataSensor["value"] = serialized(Helpers::render_value(s, sensor.value(), 2)); // float
break;
default:
dataSensor["value"] = (uint8_t)sensor.value(); // convert to char for 1 or 0