mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 09:17:46 +01:00
Allow wizard to specify secrets (#2875)
This commit is contained in:
parent
49932747b3
commit
1db7043a4d
1 changed files with 5 additions and 6 deletions
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue