Skip to content
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 bad UUIDs from third-party Chromecasts #486

Merged
merged 3 commits into from Apr 6, 2021
Merged

Handle bad UUIDs from third-party Chromecasts #486

merged 3 commits into from Apr 6, 2021

Conversation

illixion
Copy link
Contributor

@illixion illixion commented Apr 5, 2021

Certain third-party Chromecast emulators like Reflector 4 broadcast bad UUIDs, which results in the entire pychromecast module failing to discover any devices when they're on the same network. This resolves the issue by ignoring said devices.

This also resolves issue #288.

For reference, this is the error message that pychromecast generates:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 1755, in run
    self._service_state_changed.fire(
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 1513, in fire
    h(**kwargs)
  File "/usr/local/lib/python3.8/site-packages/zeroconf/__init__.py", line 1611, in on_change
    listener.add_service(*args)
  File "/usr/local/lib/python3.8/site-packages/pychromecast/discovery.py", line 65, in add_service
    self._add_update_service(zconf, typ, name, self.add_callback)
  File "/usr/local/lib/python3.8/site-packages/pychromecast/discovery.py", line 107, in _add_update_service
    uuid = UUID(uuid)
  File "/usr/local/lib/python3.8/uuid.py", line 171, in __init__
    raise ValueError('badly formed hexadecimal UUID string')
ValueError: badly formed hexadecimal UUID string

Manual added 2 commits April 6, 2021 01:20
Certain third-party Chromecast emulators may broadcast bad UUIDs, which results in the entire pychromecast module failing to discover any devices. This will resolve the issue by ignoring said devices.
@emontnemery
Copy link
Collaborator

Thanks!

@emontnemery emontnemery merged commit cc6c3e9 into home-assistant-libs:master Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants