mirror of
https://github.com/esphome/esphome.git
synced 2024-11-12 10:16:02 +01:00
Housecleaning: Use walrus operator in text (#6560)
This commit is contained in:
parent
717cea548f
commit
2fc2d5839f
@ -73,8 +73,8 @@ async def setup_text_core_(
|
||||
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
|
||||
await automation.build_automation(trigger, [(cg.std_string, "x")], conf)
|
||||
|
||||
if CONF_MQTT_ID in config:
|
||||
mqtt_ = cg.new_Pvariable(config[CONF_MQTT_ID], var)
|
||||
if (mqtt_id := config.get(CONF_MQTT_ID)) is not None:
|
||||
mqtt_ = cg.new_Pvariable(mqtt_id, var)
|
||||
await mqtt.register_mqtt_component(mqtt_, config)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user