mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-31 02:08:26 +02:00
Button device class (#2835)
This commit is contained in:
@@ -30,6 +30,11 @@ void MQTTButtonComponent::dump_config() {
|
||||
LOG_MQTT_COMPONENT(true, true);
|
||||
}
|
||||
|
||||
void MQTTButtonComponent::send_discovery(JsonObject &root, mqtt::SendDiscoveryConfig &config) {
|
||||
if (!this->button_->get_device_class().empty())
|
||||
root[MQTT_DEVICE_CLASS] = this->button_->get_device_class();
|
||||
}
|
||||
|
||||
std::string MQTTButtonComponent::component_type() const { return "button"; }
|
||||
const EntityBase *MQTTButtonComponent::get_entity() const { return this->button_; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user