-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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
Handle missing or incorrect device name and unique id for ESPHome during manual add #95678
Conversation
If we did not have the device name during setup we could never get the key from the dashboard. The device will send us its name if we try encryption which allows us to find the right key from the dashboard. This should help get users unstuck when they change the key and cannot get the device back online after deleting and trying to set it up again manually
Hey there @OttoWinter, @jesserockz, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
needs another round of functional testing |
Something isn't working right with preventing multiple of the same device. Nothing is stopping my from setting it up twice |
That explains all the issues with conflicting devices |
the user step never sets the unique id 🤦 |
Let's get that fixed |
I think |
doesn't seem to be the problem... so something outside esphome maybe |
nope that is the problem the zeroconf one is lowercase and the device info is upper case |
It was hard to find the issue because we have this code which fixes it after it sets up the dupe
|
opened esphome/esphome#5034 to start advertising if encryption is on so we don't have to probe. Thats for the future though |
Now I know how I broke my production system in testing a few months ago 🤦 |
…fix_device_name_esphome
…ing manual add (#95678) * Handle incorrect or missing device name for ESPHome noise encryption If we did not have the device name during setup we could never get the key from the dashboard. The device will send us its name if we try encryption which allows us to find the right key from the dashboard. This should help get users unstuck when they change the key and cannot get the device back online after deleting and trying to set it up again manually * bump lib to get name * tweak * reduce number of connections * less connections when we know we will fail * coverage shows it works but it does not * add more coverage * fix test * bump again
Proposed change
upstream changelog: esphome/aioesphomeapi@v15.0.1...v15.1.1
If we did not have the device name during setup we could never get the key from the dashboard. The device will send us its name if we try encryption which allows us to find the right key from the dashboard.
When the unique id was configured manually it would be uppercase, but zeroconf would discovery it lower case which would mean you could set up the same device multiple times and things would break.
This should help get users unstuck (this is common when users are using the device across subnets / remote / no mdns ) when they change the key and cannot get the device back online after deleting and trying to set it up again manually because they have trouble finding the right key.
This also brings the config flow coverage to 100%
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: