ESPHome  2024.11.3
subscribe_state.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "esphome/core/defines.h"
4 #ifdef USE_API
8 namespace esphome {
9 namespace api {
10 
11 class APIConnection;
12 
14  public:
16 #ifdef USE_BINARY_SENSOR
18 #endif
19 #ifdef USE_COVER
20  bool on_cover(cover::Cover *cover) override;
21 #endif
22 #ifdef USE_FAN
23  bool on_fan(fan::Fan *fan) override;
24 #endif
25 #ifdef USE_LIGHT
26  bool on_light(light::LightState *light) override;
27 #endif
28 #ifdef USE_SENSOR
29  bool on_sensor(sensor::Sensor *sensor) override;
30 #endif
31 #ifdef USE_SWITCH
32  bool on_switch(switch_::Switch *a_switch) override;
33 #endif
34 #ifdef USE_BUTTON
35  bool on_button(button::Button *button) override { return true; };
36 #endif
37 #ifdef USE_TEXT_SENSOR
38  bool on_text_sensor(text_sensor::TextSensor *text_sensor) override;
39 #endif
40 #ifdef USE_CLIMATE
41  bool on_climate(climate::Climate *climate) override;
42 #endif
43 #ifdef USE_NUMBER
44  bool on_number(number::Number *number) override;
45 #endif
46 #ifdef USE_DATETIME_DATE
47  bool on_date(datetime::DateEntity *date) override;
48 #endif
49 #ifdef USE_DATETIME_TIME
50  bool on_time(datetime::TimeEntity *time) override;
51 #endif
52 #ifdef USE_DATETIME_DATETIME
53  bool on_datetime(datetime::DateTimeEntity *datetime) override;
54 #endif
55 #ifdef USE_TEXT
56  bool on_text(text::Text *text) override;
57 #endif
58 #ifdef USE_SELECT
59  bool on_select(select::Select *select) override;
60 #endif
61 #ifdef USE_LOCK
62  bool on_lock(lock::Lock *a_lock) override;
63 #endif
64 #ifdef USE_VALVE
65  bool on_valve(valve::Valve *valve) override;
66 #endif
67 #ifdef USE_MEDIA_PLAYER
68  bool on_media_player(media_player::MediaPlayer *media_player) override;
69 #endif
70 #ifdef USE_ALARM_CONTROL_PANEL
71  bool on_alarm_control_panel(alarm_control_panel::AlarmControlPanel *a_alarm_control_panel) override;
72 #endif
73 #ifdef USE_EVENT
74  bool on_event(event::Event *event) override { return true; };
75 #endif
76 #ifdef USE_UPDATE
77  bool on_update(update::UpdateEntity *update) override;
78 #endif
79  protected:
81 };
82 
83 } // namespace api
84 } // namespace esphome
85 #endif
Base class for all switches.
Definition: switch.h:39
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
Definition: light_state.h:63
Base class for all cover devices.
Definition: cover.h:111
bool on_light(light::LightState *light) override
bool on_date(datetime::DateEntity *date) override
Base class for all buttons.
Definition: button.h:29
bool on_text_sensor(text_sensor::TextSensor *text_sensor) override
Base-class for all text inputs.
Definition: text.h:24
bool on_number(number::Number *number) override
InitialStateIterator(APIConnection *client)
bool on_lock(lock::Lock *a_lock) override
bool on_sensor(sensor::Sensor *sensor) override
bool on_time(datetime::TimeEntity *time) override
bool on_text(text::Text *text) override
Base-class for all numbers.
Definition: number.h:39
bool on_media_player(media_player::MediaPlayer *media_player) override
bool on_update(update::UpdateEntity *update) override
bool on_select(select::Select *select) override
esphome::binary_sensor::BinarySensor * binary_sensor
Definition: statsd.h:41
bool on_climate(climate::Climate *climate) override
bool on_cover(cover::Cover *cover) override
bool on_valve(valve::Valve *valve) override
Base-class for all selects.
Definition: select.h:31
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base class for all valve devices.
Definition: valve.h:105
bool on_event(event::Event *event) override
Base class for all binary_sensor-type classes.
Definition: binary_sensor.h:37
bool on_binary_sensor(binary_sensor::BinarySensor *binary_sensor) override
bool on_datetime(datetime::DateTimeEntity *datetime) override
Base-class for all sensors.
Definition: sensor.h:57
bool on_button(button::Button *button) override
bool on_fan(fan::Fan *fan) override
esphome::sensor::Sensor * sensor
Definition: statsd.h:38
bool on_alarm_control_panel(alarm_control_panel::AlarmControlPanel *a_alarm_control_panel) override
Base class for all locks.
Definition: lock.h:103
bool on_switch(switch_::Switch *a_switch) override
ClimateDevice - This is the base class for all climate integrations.
Definition: climate.h:168