ESPHome 2026.1.5
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::mqtt {
12
14 public:
15 explicit MQTTValveComponent(valve::Valve *valve);
16
17 void setup() override;
18 void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override;
19
22
23 bool send_initial_state() override;
24
25 bool publish_state();
26
27 void dump_config() override;
28
29 protected:
30 const char *component_type() const override;
31 const EntityBase *get_entity() const override;
32
33 valve::Valve *valve_;
34};
35
36} // namespace esphome::mqtt
37
38#endif
39#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
const char * component_type() const override
Base class for all valve devices.
Definition valve.h:106
float position
Definition cover.h:0
bool state
Definition fan.h:0
Simple Helper struct used for Home Assistant MQTT send_discovery().