-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow preserving WiFi credentials entered with captive_portal #3813
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue here is that if you flash a YAML over top that has credentials "built in", they wont work unless you remove the keep_user_credentials: true
so there needs to be some validation on the config there to prevent both at the same time.
Right, that's a good point! I'll refactor that tomorrow. EDIT: Is a runtime (or compile-time) verification also required (in the C++ code)? |
Okay, the option is now incompatible with either Failed config
wifi: [source .\aubess-4b1-03h4-01.yml:35]
WiFi credentials cannot be used together with keep_user_credentials.
keep_user_credentials: True
ssid: 127.0.0.1
ap:
password: FallbackApPassword The corresponding esphome-docs PR has also been updated to make that clear. |
Hey there @OttoWinter, mind taking a look at this pull request as it has been labeled with an integration ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels weird the way this works, but its fine.
Just a rename of the define below please.
What does this implement/fix?
This PR allows the user to preserve the WiFi credentials, that were entered using
captive_portal
, over subsequent OTA updates. I think this may be a useful feature, given that guides likeSharing ESPHome devices
exist, and the recent addition of a "factory reset" component. When usingkeep_user_credentials
, the user can freely reconfigure a device to a different network in a WiFiManager-like manner, whether it's a DIY, tuya-converted, or vendor-supplied ESPHome device.Types of changes
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#2301
Test Environment
Example entry for
config.yaml
:Checklist:
tests/
folder).