Update esphome/components/lps22/sensor.py

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Simonas Kazlauskas 2024-10-15 17:08:04 +03:00 committed by GitHub
parent a1b395dbee
commit 0b962f32db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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