From 93421f0fa71e09f173f8e8e15b29abe67e9f578a Mon Sep 17 00:00:00 2001 From: Samuel Sieb Date: Wed, 8 Jun 2022 20:27:04 -0700 Subject: [PATCH] publish fan speed count for discovery (#3537) Co-authored-by: Samuel Sieb --- esphome/components/mqtt/mqtt_fan.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/esphome/components/mqtt/mqtt_fan.cpp b/esphome/components/mqtt/mqtt_fan.cpp index 6433ead6b2..32892199fe 100644 --- a/esphome/components/mqtt/mqtt_fan.cpp +++ b/esphome/components/mqtt/mqtt_fan.cpp @@ -114,6 +114,7 @@ void MQTTFanComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig if (this->state_->get_traits().supports_speed()) { root[MQTT_PERCENTAGE_COMMAND_TOPIC] = this->get_speed_level_command_topic(); root[MQTT_PERCENTAGE_STATE_TOPIC] = this->get_speed_level_state_topic(); + root[MQTT_SPEED_RANGE_MAX] = this->state_->get_traits().supported_speed_count(); } } bool MQTTFanComponent::publish_state() {