mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 13:34:54 +01:00
Add default object_id_generator for mqtt (#3389)
This commit is contained in:
parent
b4a86ce6cf
commit
047c18eac0
2 changed files with 7 additions and 1 deletions
|
@ -556,7 +556,12 @@ void MQTTClientComponent::disable_last_will() { this->last_will_.topic = ""; }
|
||||||
|
|
||||||
void MQTTClientComponent::disable_discovery() {
|
void MQTTClientComponent::disable_discovery() {
|
||||||
this->discovery_info_ = MQTTDiscoveryInfo{
|
this->discovery_info_ = MQTTDiscoveryInfo{
|
||||||
.prefix = "", .retain = false, .clean = false, .unique_id_generator = MQTT_LEGACY_UNIQUE_ID_GENERATOR};
|
.prefix = "",
|
||||||
|
.retain = false,
|
||||||
|
.clean = false,
|
||||||
|
.unique_id_generator = MQTT_LEGACY_UNIQUE_ID_GENERATOR,
|
||||||
|
.object_id_generator = MQTT_NONE_OBJECT_ID_GENERATOR,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
void MQTTClientComponent::on_shutdown() {
|
void MQTTClientComponent::on_shutdown() {
|
||||||
if (!this->shutdown_message_.topic.empty()) {
|
if (!this->shutdown_message_.topic.empty()) {
|
||||||
|
|
|
@ -277,6 +277,7 @@ class MQTTClientComponent : public Component {
|
||||||
.retain = true,
|
.retain = true,
|
||||||
.clean = false,
|
.clean = false,
|
||||||
.unique_id_generator = MQTT_LEGACY_UNIQUE_ID_GENERATOR,
|
.unique_id_generator = MQTT_LEGACY_UNIQUE_ID_GENERATOR,
|
||||||
|
.object_id_generator = MQTT_NONE_OBJECT_ID_GENERATOR,
|
||||||
};
|
};
|
||||||
std::string topic_prefix_{};
|
std::string topic_prefix_{};
|
||||||
MQTTMessage log_message_;
|
MQTTMessage log_message_;
|
||||||
|
|
Loading…
Reference in a new issue