Add exception for unsupported provisioning methods#1586
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1586 +/- ##
==========================================
- Coverage 93.21% 93.12% -0.10%
==========================================
Files 157 157
Lines 9819 9845 +26
Branches 1005 1008 +3
==========================================
+ Hits 9153 9168 +15
- Misses 472 481 +9
- Partials 194 196 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@rytilahti I wanted to let you know that I had a user report an issue with the homebridge-kasa-python plugin about this but the obd_src was "amazon_atr" and it was discovering the device but failing to authenticate until they re-added it as "tplink". |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
…wlist of known working sources
d6c3584 to
f21fb36
Compare
| try: | ||
| await self._update(update_children) | ||
| except AuthenticationError as ex: | ||
| obd_src = self._discovery_info and self._discovery_info.get("obd_src") |
There was a problem hiding this comment.
This is done here as we do not know during the discovery time, pre-update, if the credentials are wrong or if we do not just support the authentication.
The known good sources are based on our fixtures, tss and amazon's obd are not supported, but maybe there exists also others, so we do not want to raise during the discovery to avoid raising unnecessarily.
There was a problem hiding this comment.
I think this should be fine for now and when we go through the discovery process completely, we can handle authentication and unsupported errors separately.
| try: | ||
| await dev.update() | ||
| except UnsupportedAuthenticationError as ex: | ||
| await print_unsupported(ex) |
There was a problem hiding this comment.
If print_discovered already holds the sem, calling print_unsupported will try to grab the same sem and cause a deadlock.
| try: | ||
| await dev.update() | ||
| except UnsupportedAuthenticationError as ex: | ||
| await print_unsupported(ex) |
We frequently receive reports from users who have issues with credentials.
One of the most common cases, besides the mobile app users' uppercasing the first letter, is due to the provisioning through "tplink simple setup" (tss) where the newly provisioned devices do not accept the regular credentials.
This PR adds a new exception that can be caught to display user a more detailed message about what they can do to fix the issue.
This has not been tested yet, so drafting for now.
Fixes #1573