From acc3b7a254170bfb0cb48b08b7f788783790ac65 Mon Sep 17 00:00:00 2001 From: Nick Kinnan Date: Tue, 15 Oct 2024 22:37:32 -0700 Subject: [PATCH] Update event.cpp --- esphome/components/event/event.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/event/event.cpp b/esphome/components/event/event.cpp index a2f4ecd8ee..53087a3db8 100644 --- a/esphome/components/event/event.cpp +++ b/esphome/components/event/event.cpp @@ -13,8 +13,8 @@ void Event::trigger(const std::string &event_type) { ESP_LOGE(TAG, "'%s': invalid event type for trigger(): %s", this->get_name().c_str(), event_type.c_str()); return; } - state = &(*found); - ESP_LOGD(TAG, "'%s' Triggered event '%s'", this->get_name().c_str(), state->c_str()); + last_event_type_ = &(*found); + ESP_LOGD(TAG, "'%s' Triggered event '%s'", this->get_name().c_str(), last_event_type_->c_str()); this->event_callback_.call(event_type); }