From 7c992d1ad3aed4335e207c6aec0f4e15d3042aca Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 22 Sep 2026 23:59:43 +0100 Subject: [PATCH] [at581x] Apply configured false and zero values in the settings action --- esphome/components/at581x/__init__.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/esphome/components/at581x/__init__.py b/esphome/components/at581x/__init__.py index 193e62f6157..0a15cf849c3 100644 --- a/esphome/components/at581x/__init__.py +++ b/esphome/components/at581x/__init__.py @@ -181,11 +181,11 @@ async def at581x_settings_to_code( await cg.register_parented(var, config[CONF_ID]) # Radar configuration - if frontend_reset := config.get(CONF_HW_FRONTEND_RESET): + if (frontend_reset := config.get(CONF_HW_FRONTEND_RESET)) is not None: template_ = await cg.templatable(frontend_reset, args, cg.int8) cg.add(var.set_hw_frontend_reset(template_)) - if freq := config.get(CONF_FREQUENCY): + if (freq := config.get(CONF_FREQUENCY)) is not None: if not cg.is_template(freq): freq = int(freq / 1000000) template_ = await cg.templatable(freq, args, cg.int_) @@ -195,19 +195,19 @@ async def at581x_settings_to_code( template_ = await cg.templatable(sens_dist, args, cg.int_) cg.add(var.set_sensing_distance(template_)) - if selfcheck := config.get(CONF_POWERON_SELFCHECK_TIME): + if (selfcheck := config.get(CONF_POWERON_SELFCHECK_TIME)) is not None: template_ = await cg.templatable(selfcheck, args, cg.int_) cg.add(var.set_poweron_selfcheck_time(template_)) - if protect := config.get(CONF_PROTECT_TIME): + if (protect := config.get(CONF_PROTECT_TIME)) is not None: template_ = await cg.templatable(protect, args, cg.int_) cg.add(var.set_protect_time(template_)) - if trig_base := config.get(CONF_TRIGGER_BASE): + if (trig_base := config.get(CONF_TRIGGER_BASE)) is not None: template_ = await cg.templatable(trig_base, args, cg.int_) cg.add(var.set_trigger_base(template_)) - if trig_keep := config.get(CONF_TRIGGER_KEEP): + if (trig_keep := config.get(CONF_TRIGGER_KEEP)) is not None: template_ = await cg.templatable(trig_keep, args, cg.int_) cg.add(var.set_trigger_keep(template_)) @@ -215,7 +215,7 @@ async def at581x_settings_to_code( template_ = await cg.templatable(stage_gain, args, cg.int_) cg.add(var.set_stage_gain(template_)) - if power := config.get(CONF_POWER_CONSUMPTION): + if (power := config.get(CONF_POWER_CONSUMPTION)) is not None: if not cg.is_template(power): power = int(power * 1000000) template_ = await cg.templatable(power, args, cg.int_)