From 949e61db8d6c7642784ee79325ed7f1c49b1596c Mon Sep 17 00:00:00 2001 From: Keith Burzinski Date: Sun, 6 Oct 2024 15:00:09 -0500 Subject: [PATCH] [bang-bang] Remove ``assert()`` (#7533) --- esphome/components/bang_bang/bang_bang_climate.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/esphome/components/bang_bang/bang_bang_climate.cpp b/esphome/components/bang_bang/bang_bang_climate.cpp index b34764907f..aed97b2890 100644 --- a/esphome/components/bang_bang/bang_bang_climate.cpp +++ b/esphome/components/bang_bang/bang_bang_climate.cpp @@ -157,8 +157,11 @@ void BangBangClimate::switch_to_action_(climate::ClimateAction action) { default: trig = nullptr; } - assert(trig != nullptr); - trig->trigger(); + if (trig != nullptr) { + trig->trigger(); + } else { + ESP_LOGW(TAG, "trig not set - unsupported action"); + } this->action = action; this->prev_trigger_ = trig; this->publish_state();