list_entities.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #include "esphome/core/component.h"
  3. #include "esphome/core/defines.h"
  4. #include "util.h"
  5. namespace esphome {
  6. namespace api {
  7. class APIConnection;
  8. class ListEntitiesIterator : public ComponentIterator {
  9. public:
  10. ListEntitiesIterator(APIServer *server, APIConnection *client);
  11. #ifdef USE_BINARY_SENSOR
  12. bool on_binary_sensor(binary_sensor::BinarySensor *binary_sensor) override;
  13. #endif
  14. #ifdef USE_COVER
  15. bool on_cover(cover::Cover *cover) override;
  16. #endif
  17. #ifdef USE_FAN
  18. bool on_fan(fan::FanState *fan) override;
  19. #endif
  20. #ifdef USE_LIGHT
  21. bool on_light(light::LightState *light) override;
  22. #endif
  23. #ifdef USE_SENSOR
  24. bool on_sensor(sensor::Sensor *sensor) override;
  25. #endif
  26. #ifdef USE_SWITCH
  27. bool on_switch(switch_::Switch *a_switch) override;
  28. #endif
  29. #ifdef USE_TEXT_SENSOR
  30. bool on_text_sensor(text_sensor::TextSensor *text_sensor) override;
  31. #endif
  32. bool on_service(UserServiceDescriptor *service) override;
  33. #ifdef USE_ESP32_CAMERA
  34. bool on_camera(esp32_camera::ESP32Camera *camera) override;
  35. #endif
  36. #ifdef USE_CLIMATE
  37. bool on_climate(climate::Climate *climate) override;
  38. #endif
  39. bool on_end() override;
  40. protected:
  41. APIConnection *client_;
  42. };
  43. } // namespace api
  44. } // namespace esphome
  45. #include "api_server.h"