ESPHome 2026.1.0-dev
Loading...
Searching...
No Matches
mqtt_light.h
Go to the documentation of this file.
1#pragma once
2
4
5#ifdef USE_MQTT
6#ifdef USE_LIGHT
7
8#include "mqtt_component.h"
10
11namespace esphome {
12namespace mqtt {
13
15 public:
17
19
20 void setup() override;
21
22 void dump_config() override;
23
24 void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override;
25
26 bool send_initial_state() override;
27
28 // LightRemoteValuesListener interface
29 void on_light_remote_values_update() override;
30
31 protected:
32 std::string component_type() const override;
33 const EntityBase *get_entity() const override;
34
35 bool publish_state_();
36
38};
39
40} // namespace mqtt
41} // namespace esphome
42
43#endif
44#endif // USE_MQTT
Listener interface for light remote value changes.
Definition light_state.h:29
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
Definition light_state.h:91
MQTTComponent is the base class for all components that interact with MQTT to expose certain function...
MQTTJSONLightComponent(light::LightState *state)
const EntityBase * get_entity() const override
void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override
light::LightState * get_state() const
std::string component_type() const override
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().