Skip to content

Commit

Permalink
Housecleaning: Use walrus operator in lock (esphome#6554)
Browse files Browse the repository at this point in the history
Co-authored-by: Keith Burzinski <[email protected]>
  • Loading branch information
jesserockz and kbx81 authored Apr 17, 2024
1 parent c8cdb30 commit 72c1c3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions esphome/components/lock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ async def setup_lock_core_(var, config):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [], conf)

if CONF_MQTT_ID in config:
mqtt_ = cg.new_Pvariable(config[CONF_MQTT_ID], var)
if mqtt_id := config.get(CONF_MQTT_ID):
mqtt_ = cg.new_Pvariable(mqtt_id, var)
await mqtt.register_mqtt_component(mqtt_, config)


Expand Down

0 comments on commit 72c1c3f

Please sign in to comment.