mirror of
https://github.com/esphome/esphome.git
synced 2025-02-22 04:48:21 +00: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)
|
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
|
||||||
await automation.build_automation(trigger, [(cg.std_string, "x")], conf)
|
await automation.build_automation(trigger, [(cg.std_string, "x")], conf)
|
||||||
|
|
||||||
if CONF_MQTT_ID in config:
|
if (mqtt_id := config.get(CONF_MQTT_ID)) is not None:
|
||||||
mqtt_ = cg.new_Pvariable(config[CONF_MQTT_ID], var)
|
mqtt_ = cg.new_Pvariable(mqtt_id, var)
|
||||||
await mqtt.register_mqtt_component(mqtt_, config)
|
await mqtt.register_mqtt_component(mqtt_, config)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user