From 0b962f32dba6adbed07d205886754aa22a42df18 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Tue, 15 Oct 2024 17:08:04 +0300 Subject: [PATCH] Update esphome/components/lps22/sensor.py Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- esphome/components/lps22/sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/lps22/sensor.py b/esphome/components/lps22/sensor.py index afbbfd1c2f..5987667e58 100644 --- a/esphome/components/lps22/sensor.py +++ b/esphome/components/lps22/sensor.py @@ -53,6 +53,6 @@ async def to_code(config): sens = await sensor.new_sensor(config[CONF_TEMPERATURE]) cg.add(var.set_temperature_sensor(sens)) - if CONF_PRESSURE in config: - sens = await sensor.new_sensor(config[CONF_PRESSURE]) + if pressure_config := config.get(CONF_PRESSURE): + sens = await sensor.new_sensor(pressure_config) cg.add(var.set_pressure_sensor(sens))