diff --git a/esphome/components/switch/switch.cpp b/esphome/components/switch/switch.cpp index e4d20719e1..b9b99b4147 100644 --- a/esphome/components/switch/switch.cpp +++ b/esphome/components/switch/switch.cpp @@ -34,7 +34,7 @@ void Switch::publish_state(bool state) { this->state = state != this->inverted_; this->rtc_.save(&this->state); - ESP_LOGD(TAG, "'%s': Sending state %s", this->name_.c_str(), ONOFF(state)); + ESP_LOGD(TAG, "'%s': Sending state %s", this->name_.c_str(), ONOFF(this->state)); this->state_callback_.call(this->state); } bool Switch::assumed_state() { return false; }