8#ifdef USE_BINARY_SENSOR
10 if (include_internal || !obj->is_internal()) {
11 obj->add_full_state_callback(
17 for (
auto *obj :
App.get_fans()) {
18 if (include_internal || !obj->is_internal())
19 obj->add_on_state_callback([
this, obj]() { this->
on_fan_update(obj); });
23 for (
auto *obj :
App.get_lights()) {
24 if (include_internal || !obj->is_internal())
25 obj->add_new_remote_values_callback([
this, obj]() { this->
on_light_update(obj); });
29 for (
auto *obj :
App.get_sensors()) {
30 if (include_internal || !obj->is_internal())
35 for (
auto *obj :
App.get_switches()) {
36 if (include_internal || !obj->is_internal())
41 for (
auto *obj :
App.get_covers()) {
42 if (include_internal || !obj->is_internal())
43 obj->add_on_state_callback([
this, obj]() { this->
on_cover_update(obj); });
47 for (
auto *obj :
App.get_text_sensors()) {
48 if (include_internal || !obj->is_internal())
53 for (
auto *obj :
App.get_climates()) {
54 if (include_internal || !obj->is_internal())
59 for (
auto *obj :
App.get_numbers()) {
60 if (include_internal || !obj->is_internal())
64#ifdef USE_DATETIME_DATE
65 for (
auto *obj :
App.get_dates()) {
66 if (include_internal || !obj->is_internal())
67 obj->add_on_state_callback([
this, obj]() { this->
on_date_update(obj); });
70#ifdef USE_DATETIME_TIME
71 for (
auto *obj :
App.get_times()) {
72 if (include_internal || !obj->is_internal())
73 obj->add_on_state_callback([
this, obj]() { this->
on_time_update(obj); });
76#ifdef USE_DATETIME_DATETIME
77 for (
auto *obj :
App.get_datetimes()) {
78 if (include_internal || !obj->is_internal())
83 for (
auto *obj :
App.get_texts()) {
84 if (include_internal || !obj->is_internal())
89 for (
auto *obj :
App.get_selects()) {
90 if (include_internal || !obj->is_internal()) {
91 obj->add_on_state_callback(
97 for (
auto *obj :
App.get_locks()) {
98 if (include_internal || !obj->is_internal())
99 obj->add_on_state_callback([
this, obj]() { this->
on_lock_update(obj); });
103 for (
auto *obj :
App.get_valves()) {
104 if (include_internal || !obj->is_internal())
105 obj->add_on_state_callback([
this, obj]() { this->
on_valve_update(obj); });
108#ifdef USE_MEDIA_PLAYER
109 for (
auto *obj :
App.get_media_players()) {
110 if (include_internal || !obj->is_internal())
114#ifdef USE_ALARM_CONTROL_PANEL
115 for (
auto *obj :
App.get_alarm_control_panels()) {
116 if (include_internal || !obj->is_internal())
121 for (
auto *obj :
App.get_events()) {
122 if (include_internal || !obj->is_internal())
123 obj->add_on_event_callback([
this, obj](
const std::string &event_type) { this->
on_event(obj, event_type); });
127 for (
auto *obj :
App.get_updates()) {
128 if (include_internal || !obj->is_internal())
129 obj->add_on_state_callback([
this, obj]() { this->
on_update(obj); });