ESPHome  2023.11.6
Go to the documentation of this file.
1 #pragma once
6 #include "esphome/core/defines.h"
8 namespace esphome {
9 namespace api {
11 class APIConnection;
14  public:
17  bool on_binary_sensor(binary_sensor::BinarySensor *binary_sensor) override;
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
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_TEXT
47  bool on_text(text::Text *text) override;
48 #endif
49 #ifdef USE_SELECT
50  bool on_select(select::Select *select) override;
51 #endif
52 #ifdef USE_LOCK
53  bool on_lock(lock::Lock *a_lock) override;
54 #endif
56  bool on_media_player(media_player::MediaPlayer *media_player) override;
57 #endif
59  bool on_alarm_control_panel(alarm_control_panel::AlarmControlPanel *a_alarm_control_panel) override;
60 #endif
61  protected:
63 };
65 } // namespace api
66 } // namespace esphome
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:34
Base class for all cover devices.
Definition: cover.h:111
bool on_light(light::LightState *light) 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_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_select(select::Select *select) override
bool on_climate(climate::Climate *climate) override
bool on_cover(cover::Cover *cover) override
Base-class for all selects.
Definition: select.h:31
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base class for all binary_sensor-type classes.
Definition: binary_sensor.h:37
bool on_binary_sensor(binary_sensor::BinarySensor *binary_sensor) override
Base-class for all sensors.
Definition: sensor.h:57
bool on_button(button::Button *button) override
bool on_fan(fan::Fan *fan) override
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:161