ESPHome 2026.5.0b1
Loading...
Searching...
No Matches
list_entities.h
Go to the documentation of this file.
1#pragma once
2
4#ifdef USE_API
7namespace esphome::api {
8
9class APIConnection;
10
11// Macro for generating ListEntitiesIterator handlers
12// Calls schedule_message_ which dispatches to try_send_*_info
13#define LIST_ENTITIES_HANDLER(entity_type, EntityClass, ResponseType) \
14 bool ListEntitiesIterator::on_##entity_type(EntityClass *entity) { /* NOLINT(bugprone-macro-parentheses) */ \
15 return this->client_->schedule_message_(entity, ResponseType::MESSAGE_TYPE, ResponseType::ESTIMATED_SIZE); \
16 }
17
19 public:
21
22// Entity overrides (generated from entity_types.h).
23// All implementations live in list_entities.cpp via LIST_ENTITIES_HANDLER.
24// NOLINTBEGIN(bugprone-macro-parentheses)
25#define ENTITY_TYPE_(type, singular, plural, count, upper) bool on_##singular(type *entity) override;
26#define ENTITY_CONTROLLER_TYPE_(type, singular, plural, count, upper, callback) \
27 ENTITY_TYPE_(type, singular, plural, count, upper)
29#undef ENTITY_TYPE_
30#undef ENTITY_CONTROLLER_TYPE_
31 // NOLINTEND(bugprone-macro-parentheses)
32#ifdef USE_API_USER_DEFINED_ACTIONS
33 bool on_service(UserServiceDescriptor *service) override;
34#endif
35#ifdef USE_CAMERA
36 bool on_camera(camera::Camera *entity) override;
37#endif
38 bool on_end() override;
39
40 protected:
42};
43
44} // namespace esphome::api
45#endif
ListEntitiesIterator(APIConnection *client)
bool on_camera(camera::Camera *entity) override
bool on_service(UserServiceDescriptor *service) override
Abstract camera base class.
Definition camera.h:114