mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 11:47:30 +01:00
Allow wizard to specify secrets (#2875)
This commit is contained in:
parent
49932747b3
commit
1db7043a4d
@ -86,12 +86,11 @@ def wizard_file(**kwargs):
|
||||
config += "\n\nwifi:\n"
|
||||
|
||||
if "ssid" in kwargs:
|
||||
# pylint: disable=consider-using-f-string
|
||||
config += """ ssid: "{ssid}"
|
||||
password: "{psk}"
|
||||
""".format(
|
||||
**kwargs
|
||||
)
|
||||
if kwargs["ssid"].startswith("!secret"):
|
||||
template = " ssid: {ssid}\n password: {psk}\n"
|
||||
else:
|
||||
template = """ ssid: "{ssid}"\n password: "{psk}"\n"""
|
||||
config += template.format(**kwargs)
|
||||
else:
|
||||
config += """ # ssid: "My SSID"
|
||||
# password: "mypassword"
|
||||
|
Loading…
Reference in New Issue
Block a user