diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index 84b578876c..7f8438af25 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -1311,7 +1311,7 @@ uint16_t APIConnection::try_send_event_info(EntityBase *entity, APIConnection *c ListEntitiesEventResponse msg; msg.set_device_class(event->get_device_class_ref()); for (const char *event_type : event->get_event_types()) - msg.event_types.push_back(event_type); + msg.event_types->push_back(event_type); return fill_and_encode_entity_info(event, msg, ListEntitiesEventResponse::MESSAGE_TYPE, conn, remaining_size, is_single); } diff --git a/esphome/components/event/event.h b/esphome/components/event/event.h index 74709dcac1..822785dece 100644 --- a/esphome/components/event/event.h +++ b/esphome/components/event/event.h @@ -30,16 +30,6 @@ class Event : public EntityBase, public EntityBase_DeviceClass { this->types_ = event_types; this->last_event_type_ = nullptr; // Reset when types change } - /// Set the event types supported by this event (from FixedVector). - void set_event_types(const FixedVector &event_types) { - this->types_ = event_types; - this->last_event_type_ = nullptr; // Reset when types change - } - /// Set the event types supported by this event (from C array). - template void set_event_types(const char *const (&event_types)[N]) { - this->types_.assign(event_types, event_types + N); - this->last_event_type_ = nullptr; // Reset when types change - } // Deleted overloads to catch incorrect std::string usage at compile time with clear error messages void set_event_types(std::initializer_list event_types) = delete;