ESPHome 2026.1.4
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::mqtt {
12
14 public:
16
18
19 void setup() override;
20
21 void dump_config() override;
22
23 void send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) override;
24
25 bool send_initial_state() override;
26
27 // LightRemoteValuesListener interface
28 void on_light_remote_values_update() override;
29
30 protected:
31 const char *component_type() const override;
32 const EntityBase *get_entity() const override;
33
34 bool publish_state_();
35
37};
38
39} // namespace esphome::mqtt
40
41#endif
42#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
const char * component_type() const override
light::LightState * get_state() const
bool state
Definition fan.h:0
Simple Helper struct used for Home Assistant MQTT send_discovery().