-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Improve performance #108
Improve performance #108
Conversation
c93a965
to
206cc9f
Compare
@bdraco We should be aware of the #109. The IP can also be a DNS name. Especially in the HASS config flow if I enter a DNS name of a bulb manually. Line 301 in cb6c001
I would suggest something like: def _resolve_dnsname(self, dns_or_ip: str):
"""Returns a IP in case of a DNS was given."""
try:
return socket.gethostbyname(dns_or_ip)
except socket.gaierror:
raise WizLightConnectionError("DNS name can not be resloved.") |
206cc9f
to
9e7f61e
Compare
Usually we don't want to accept dns names since if dns is having issues the device can't be setup. As soon as discovery sees the bulb it will update it to an ip address via This takes care of the case where the bulb's dhcp reservation changes.
If we do want to do allow a hostname, we need to use |
- Fixes python 3.8 typing compat - Fixes race condition during shutdown - Fixes memory leak in discovery - Fixes slow tests - No longer respond to syncPilot messages since the bulb keeps sending them anyways and all it does is generate additional network congestion - Adds test runs to the CI
9e7f61e
to
8fb3804
Compare
Ok, that makes more sense in general. I'll make the documentation clear that the library (natively) only supports IPs as input for the wizlight class. The HASS strings should be updated to "IP" because the "IP/Host" can be misleading for the user. |
Yeah, I that makes more sense. There is probably no point in resolving it for them since they can leave it blank and do discovery anyways. We should change the string though and reject anything thats not an Ip |
Yes, that looks really great! For the changes in the ConfiFlow and the IP-Address input validation, I'll open a new PR to the core. |
Improves performance when bulb is offline
Fixes python 3.8 typing compat
Fixes race condition during shutdown
Fixes memory leak in discovery
Fixes slow tests
Adds test runs to the CI
No longer respond to
syncPilot
messages since thebulb keeps sending them anyways and all it does
is generate additional network congestion
fixes #107, fixes #106, fixes #105