mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 22:48:10 +01:00
Housecleaning: Use walrus operator in datetime (#6552)
This commit is contained in:
parent
6104e7591e
commit
717cea548f
1 changed files with 2 additions and 2 deletions
|
@ -106,8 +106,8 @@ def datetime_schema(class_: MockObjClass) -> cv.Schema:
|
|||
async def setup_datetime_core_(var, config):
|
||||
await setup_entity(var, config)
|
||||
|
||||
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)
|
||||
for conf in config.get(CONF_ON_VALUE, []):
|
||||
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
|
||||
|
|
Loading…
Reference in a new issue