mirror of
https://github.com/esphome/esphome.git
synced 2025-01-30 23:02:14 +01:00
Fix mqtt climate step rounding (#8121)
This commit is contained in:
parent
8aeb08f868
commit
65b2d48a6f
@ -72,9 +72,9 @@ void MQTTClimateComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryCo
|
|||||||
// max_temp
|
// max_temp
|
||||||
root[MQTT_MAX_TEMP] = traits.get_visual_max_temperature();
|
root[MQTT_MAX_TEMP] = traits.get_visual_max_temperature();
|
||||||
// target_temp_step
|
// target_temp_step
|
||||||
root[MQTT_TARGET_TEMPERATURE_STEP] = traits.get_visual_target_temperature_step();
|
root[MQTT_TARGET_TEMPERATURE_STEP] = roundf(traits.get_visual_target_temperature_step() * 10) * 0.1;
|
||||||
// current_temp_step
|
// current_temp_step
|
||||||
root[MQTT_CURRENT_TEMPERATURE_STEP] = traits.get_visual_current_temperature_step();
|
root[MQTT_CURRENT_TEMPERATURE_STEP] = roundf(traits.get_visual_current_temperature_step() * 10) * 0.1;
|
||||||
// temperature units are always coerced to Celsius internally
|
// temperature units are always coerced to Celsius internally
|
||||||
root[MQTT_TEMPERATURE_UNIT] = "C";
|
root[MQTT_TEMPERATURE_UNIT] = "C";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user