5#ifdef USE_CONTROLLER_REGISTRY
14#ifdef USE_BINARY_SENSOR
15namespace binary_sensor {
51namespace text_sensor {
68#ifdef USE_DATETIME_DATE
74#ifdef USE_DATETIME_TIME
80#ifdef USE_DATETIME_DATETIME
110#ifdef USE_MEDIA_PLAYER
111namespace media_player {
116#ifdef USE_ALARM_CONTROL_PANEL
117namespace alarm_control_panel {
118class AlarmControlPanel;
122#ifdef USE_WATER_HEATER
123namespace water_heater {
165#ifdef USE_BINARY_SENSOR
189#ifdef USE_TEXT_SENSOR
201#ifdef USE_DATETIME_DATE
205#ifdef USE_DATETIME_TIME
209#ifdef USE_DATETIME_DATETIME
229#ifdef USE_MEDIA_PLAYER
233#ifdef USE_ALARM_CONTROL_PANEL
237#ifdef USE_WATER_HEATER
268#define CONTROLLER_REGISTRY_NOTIFY(entity_type, entity_name) \
269 inline void ControllerRegistry::notify_##entity_name##_update(entity_type *obj) { \
270 for (auto *controller : controllers) { \
271 controller->on_##entity_name##_update(obj); \
275#define CONTROLLER_REGISTRY_NOTIFY_NO_UPDATE_SUFFIX(entity_type, entity_name) \
276 inline void ControllerRegistry::notify_##entity_name(entity_type *obj) { \
277 for (auto *controller : controllers) { \
278 controller->on_##entity_name(obj); \
283#ifdef USE_BINARY_SENSOR
284CONTROLLER_REGISTRY_NOTIFY(binary_sensor::BinarySensor, binary_sensor)
288CONTROLLER_REGISTRY_NOTIFY(fan::Fan, fan)
292CONTROLLER_REGISTRY_NOTIFY(light::LightState, light)
296CONTROLLER_REGISTRY_NOTIFY(sensor::Sensor, sensor)
300CONTROLLER_REGISTRY_NOTIFY(switch_::Switch,
switch)
304CONTROLLER_REGISTRY_NOTIFY(cover::Cover, cover)
307#ifdef USE_TEXT_SENSOR
308CONTROLLER_REGISTRY_NOTIFY(text_sensor::TextSensor, text_sensor)
312CONTROLLER_REGISTRY_NOTIFY(climate::Climate, climate)
316CONTROLLER_REGISTRY_NOTIFY(number::Number, number)
319#ifdef USE_DATETIME_DATE
320CONTROLLER_REGISTRY_NOTIFY(datetime::DateEntity, date)
323#ifdef USE_DATETIME_TIME
324CONTROLLER_REGISTRY_NOTIFY(datetime::TimeEntity, time)
327#ifdef USE_DATETIME_DATETIME
328CONTROLLER_REGISTRY_NOTIFY(datetime::DateTimeEntity, datetime)
332CONTROLLER_REGISTRY_NOTIFY(text::Text, text)
336CONTROLLER_REGISTRY_NOTIFY(select::Select, select)
340CONTROLLER_REGISTRY_NOTIFY(lock::Lock, lock)
344CONTROLLER_REGISTRY_NOTIFY(valve::Valve, valve)
347#ifdef USE_MEDIA_PLAYER
348CONTROLLER_REGISTRY_NOTIFY(media_player::MediaPlayer, media_player)
351#ifdef USE_ALARM_CONTROL_PANEL
352CONTROLLER_REGISTRY_NOTIFY(alarm_control_panel::AlarmControlPanel, alarm_control_panel)
355#ifdef USE_WATER_HEATER
356CONTROLLER_REGISTRY_NOTIFY(water_heater::WaterHeater, water_heater)
360CONTROLLER_REGISTRY_NOTIFY_NO_UPDATE_SUFFIX(event::Event, event)
364CONTROLLER_REGISTRY_NOTIFY_NO_UPDATE_SUFFIX(update::UpdateEntity, update)
367#undef CONTROLLER_REGISTRY_NOTIFY
368#undef CONTROLLER_REGISTRY_NOTIFY_NO_UPDATE_SUFFIX
Global registry for Controllers to receive entity state updates.
static void notify_select_update(select::Select *obj)
static void notify_binary_sensor_update(binary_sensor::BinarySensor *obj)
static void notify_datetime_update(datetime::DateTimeEntity *obj)
static void notify_cover_update(cover::Cover *obj)
static void notify_date_update(datetime::DateEntity *obj)
static void notify_event(event::Event *obj)
static void notify_lock_update(lock::Lock *obj)
static void notify_time_update(datetime::TimeEntity *obj)
static void notify_update(update::UpdateEntity *obj)
static void notify_sensor_update(sensor::Sensor *obj)
static void notify_text_update(text::Text *obj)
static void notify_light_update(light::LightState *obj)
static void notify_number_update(number::Number *obj)
static void notify_valve_update(valve::Valve *obj)
static void notify_text_sensor_update(text_sensor::TextSensor *obj)
static void notify_media_player_update(media_player::MediaPlayer *obj)
static void notify_alarm_control_panel_update(alarm_control_panel::AlarmControlPanel *obj)
static void notify_water_heater_update(water_heater::WaterHeater *obj)
static void register_controller(Controller *controller)
Register a controller to receive entity state updates.
static void notify_climate_update(climate::Climate *obj)
static void notify_fan_update(fan::Fan *obj)
static StaticVector< Controller *, CONTROLLER_REGISTRY_MAX > controllers
static void notify_switch_update(switch_::Switch *obj)
Minimal static vector - saves memory by avoiding std::vector overhead.
Base class for all binary_sensor-type classes.
ClimateDevice - This is the base class for all climate integrations.
Base class for all cover devices.
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
Base class for all locks.
Base-class for all numbers.
Base-class for all selects.
Base-class for all sensors.
Base class for all switches.
Base-class for all text inputs.
Base class for all valve devices.
Providing packet encoding functions for exchanging data with a remote host.