From 047a744ed387a9e4d5f702fca83ae48e5d38b524 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 22 Mar 2026 16:02:51 -1000 Subject: [PATCH] [binary_sensor] Inline send_state_internal into header --- esphome/components/binary_sensor/binary_sensor.cpp | 4 ---- esphome/components/binary_sensor/binary_sensor.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/esphome/components/binary_sensor/binary_sensor.cpp b/esphome/components/binary_sensor/binary_sensor.cpp index 35d7b3e430..3ccaaf8f03 100644 --- a/esphome/components/binary_sensor/binary_sensor.cpp +++ b/esphome/components/binary_sensor/binary_sensor.cpp @@ -32,10 +32,6 @@ void BinarySensor::publish_initial_state(bool new_state) { this->invalidate_state(); this->publish_state(new_state); } -void BinarySensor::send_state_internal(bool new_state) { - // set_new_state handles de-duplication, updating this->state via set_state_value_(), and triggering callbacks - this->set_new_state(new_state); -} bool BinarySensor::set_new_state(const optional &new_state) { if (StatefulEntityBase::set_new_state(new_state)) { diff --git a/esphome/components/binary_sensor/binary_sensor.h b/esphome/components/binary_sensor/binary_sensor.h index 6263844f7f..6e6f77e010 100644 --- a/esphome/components/binary_sensor/binary_sensor.h +++ b/esphome/components/binary_sensor/binary_sensor.h @@ -57,7 +57,7 @@ class BinarySensor : public StatefulEntityBase { // ========== INTERNAL METHODS ========== // (In most use cases you won't need these) - void send_state_internal(bool new_state); + void send_state_internal(bool new_state) { this->set_new_state(new_state); } /// Return whether this binary sensor has outputted a state. virtual bool is_status_binary_sensor() const;