1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-12 14:53:49 +01:00

missed python

This commit is contained in:
J. Nick Koston
2025-10-07 14:02:39 -10:00
parent fa66b3235d
commit a991768772

View File

@@ -61,7 +61,7 @@ CONFIG_SCHEMA = cv.All(
def mdns_txt_record(key: str, value: str):
return cg.StructInitializer(
MDNSTXTRecord,
("key", key),
("key", cg.RawExpression(f"MDNS_STR({cg.safe_exp(key)})")),
("value", value),
)
@@ -71,8 +71,8 @@ def mdns_service(
):
return cg.StructInitializer(
MDNSService,
("service_type", service),
("proto", proto),
("service_type", cg.RawExpression(f"MDNS_STR({cg.safe_exp(service)})")),
("proto", cg.RawExpression(f"MDNS_STR({cg.safe_exp(proto)})")),
("port", port),
("txt_records", txt_records),
)
@@ -114,7 +114,7 @@ async def to_code(config):
txt = [
cg.StructInitializer(
MDNSTXTRecord,
("key", txt_key),
("key", cg.RawExpression(f"MDNS_STR({cg.safe_exp(txt_key)})")),
("value", await cg.templatable(txt_value, [], cg.std_string)),
)
for txt_key, txt_value in service[CONF_TXT].items()