ESPHome 2025.5.0
Loading...
Searching...
No Matches
mqtt_cover.h
Go to the documentation of this file.
1#pragma once
2
4#include "mqtt_component.h"
5
6#ifdef USE_MQTT
7#ifdef USE_COVER
8
10
11namespace esphome {
12namespace mqtt {
13
15 public:
16 explicit MQTTCoverComponent(cover::Cover *cover);
17
18 void setup() override;
19 void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override;
20
25
26 bool send_initial_state() override;
27
28 bool publish_state();
29
30 void dump_config() override;
31
32 protected:
33 std::string component_type() const override;
34 const EntityBase *get_entity() const override;
35
36 cover::Cover *cover_;
37};
38
39} // namespace mqtt
40} // namespace esphome
41
42#endif
43#endif // USE_MQTT
Base class for all cover devices.
Definition cover.h:111
MQTTComponent is the base class for all components that interact with MQTT to expose certain function...
void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override
MQTTCoverComponent(cover::Cover *cover)
const EntityBase * get_entity() const override
state state bool send_initial_state() override
MQTT_COMPONENT_CUSTOM_TOPIC(position, command) MQTT_COMPONENT_CUSTOM_TOPIC(position
std::string component_type() const override
float position
Definition cover.h:0
float tilt
Definition cover.h:1
bool state
Definition fan.h:0
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
Simple Helper struct used for Home Assistant MQTT send_discovery().