[bang-bang] Remove `assert()` (#7533)

This commit is contained in:
Keith Burzinski 2024-10-06 15:00:09 -05:00 committed by GitHub
parent e31a96bfe2
commit 949e61db8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();