mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 09:17:46 +01:00
Housecleaning: Use walrus operator in lock (#6554)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
This commit is contained in:
parent
c8cdb30459
commit
72c1c3f091
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue