Allow wizard to specify secrets (#2875)

This commit is contained in:
Jesse Hills 2021-12-06 20:58:51 +13:00
parent 24874f4c3c
commit 7ee4bb621c
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A

View File

@ -86,12 +86,11 @@ def wizard_file(**kwargs):
config += "\n\nwifi:\n" config += "\n\nwifi:\n"
if "ssid" in kwargs: if "ssid" in kwargs:
# pylint: disable=consider-using-f-string if kwargs["ssid"].startswith("!secret"):
config += """ ssid: "{ssid}" template = " ssid: {ssid}\n password: {psk}\n"
password: "{psk}" else:
""".format( template = """ ssid: "{ssid}"\n password: "{psk}"\n"""
**kwargs config += template.format(**kwargs)
)
else: else:
config += """ # ssid: "My SSID" config += """ # ssid: "My SSID"
# password: "mypassword" # password: "mypassword"