ESPHome 2025.5.0
Loading...
Searching...
No Matches
mqtt_valve.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_VALVE
8
10
11namespace esphome {
12namespace mqtt {
13
15 public:
16 explicit MQTTValveComponent(valve::Valve *valve);
17
18 void setup() override;
19 void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override;
20
23
24 bool send_initial_state() override;
25
26 bool publish_state();
27
28 void dump_config() override;
29
30 protected:
31 std::string component_type() const override;
32 const EntityBase *get_entity() const override;
33
35};
36
37} // namespace mqtt
38} // namespace esphome
39
40#endif
41#endif // USE_MQTT
MQTTComponent is the base class for all components that interact with MQTT to expose certain function...
MQTT_COMPONENT_CUSTOM_TOPIC(position, command) MQTT_COMPONENT_CUSTOM_TOPIC(position
state bool send_initial_state() override
MQTTValveComponent(valve::Valve *valve)
const EntityBase * get_entity() const override
void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override
std::string component_type() const override
Base class for all valve devices.
Definition valve.h:105
float position
Definition cover.h:0
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().