Merge pull request #927 from proddy/dev

HA use box for numbers now that HA supports this
This commit is contained in:
Proddy
2023-01-22 19:10:12 +01:00
committed by GitHub

View File

@@ -1090,9 +1090,7 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
} }
} else if (type != DeviceValueType::STRING) { } else if (type != DeviceValueType::STRING) {
// Must be Numeric.... // Must be Numeric....
// mode can be auto, slider or box. Because its fiddly and error prone, force conversion to box doc["mode"] = "box"; // auto, slider or box
// but... this is not currently supported in HA MQTT Number yet!
// doc["mode"] = "box";
if (num_op > 0) { if (num_op > 0) {
doc["step"] = 1.0 / num_op; doc["step"] = 1.0 / num_op;
} else if (num_op < 0) { } else if (num_op < 0) {