1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-13 07:13:47 +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): def mdns_txt_record(key: str, value: str):
return cg.StructInitializer( return cg.StructInitializer(
MDNSTXTRecord, MDNSTXTRecord,
("key", key), ("key", cg.RawExpression(f"MDNS_STR({cg.safe_exp(key)})")),
("value", value), ("value", value),
) )
@@ -71,8 +71,8 @@ def mdns_service(
): ):
return cg.StructInitializer( return cg.StructInitializer(
MDNSService, MDNSService,
("service_type", service), ("service_type", cg.RawExpression(f"MDNS_STR({cg.safe_exp(service)})")),
("proto", proto), ("proto", cg.RawExpression(f"MDNS_STR({cg.safe_exp(proto)})")),
("port", port), ("port", port),
("txt_records", txt_records), ("txt_records", txt_records),
) )
@@ -114,7 +114,7 @@ async def to_code(config):
txt = [ txt = [
cg.StructInitializer( cg.StructInitializer(
MDNSTXTRecord, MDNSTXTRecord,
("key", txt_key), ("key", cg.RawExpression(f"MDNS_STR({cg.safe_exp(txt_key)})")),
("value", await cg.templatable(txt_value, [], cg.std_string)), ("value", await cg.templatable(txt_value, [], cg.std_string)),
) )
for txt_key, txt_value in service[CONF_TXT].items() for txt_key, txt_value in service[CONF_TXT].items()