ESPHome 2026.1.5
Loading...
Searching...
No Matches
mqtt_update.h
Go to the documentation of this file.
1#pragma once
2
4
5#ifdef USE_MQTT
6#ifdef USE_UPDATE
7
9#include "mqtt_component.h"
10
11namespace esphome::mqtt {
12
14 public:
16
17 // ========== INTERNAL METHODS ==========
18 // (In most use cases you won't need these)
19 void setup() override;
20 void dump_config() override;
21
22 void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override;
23
24 bool send_initial_state() override;
25
26 bool publish_state();
27
28 protected:
30 const char *component_type() const override;
31 const EntityBase *get_entity() const override;
32
34};
35
36} // namespace esphome::mqtt
37
38#endif // USE_UPDATE
39#endif // USE_MQTT
MQTTComponent is the base class for all components that interact with MQTT to expose certain function...
MQTTUpdateComponent(update::UpdateEntity *update)
void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override
const char * component_type() const override
"update" component type.
update::UpdateEntity * update_
Definition mqtt_update.h:33
const EntityBase * get_entity() const override
Simple Helper struct used for Home Assistant MQTT send_discovery().