diff --git a/esphome/components/ld24xx/ld24xx.h b/esphome/components/ld24xx/ld24xx.h index 0428f27127..81e8d92535 100644 --- a/esphome/components/ld24xx/ld24xx.h +++ b/esphome/components/ld24xx/ld24xx.h @@ -34,8 +34,11 @@ } #define SAFE_PUBLISH_SENSOR_WITHOUT_FILTERS(sensor, value) \ - if ((sensor) != nullptr && (sensor)->sens->get_raw_state() != static_cast(value)) { \ - (sensor)->sens->publish_state(static_cast(value)); \ + if ((sensor) != nullptr) { \ + if ((sensor)->publish_dedup.next(value)) { \ + (sensor)->sens->raw_state = static_cast(value); \ + (sensor)->sens->internal_send_state_to_frontend(static_cast(value)); \ + } \ } #define highbyte(val) (uint8_t)((val) >> 8)