Add number device class support (#4042)

This commit is contained in:
Franck Nijhof
2022-11-17 20:01:28 +01:00
committed by GitHub
parent eead72333e
commit d874626662
10 changed files with 112 additions and 0 deletions
+2
View File
@@ -55,6 +55,8 @@ void MQTTNumberComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryCon
root[MQTT_MODE] = "slider";
break;
}
if (!this->number_->traits.get_device_class().empty())
root[MQTT_DEVICE_CLASS] = this->number_->traits.get_device_class();
config.command_topic = true;
}