question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

zeroconf error when protocol version not defined

See original GitHub issue

Command: python3 -m homekit.discover

Results:

Properties: {b'ff': b'1', b'ci': b'2', b'id': b'a8:1b:6a:01:d1:bc', b'sf': b'1', b'md': b'Smart Bridge 2', b'c#': b'11', b's#': b'1'}
Name: Smart Bridge 2._hap._tcp.local.
Url: http://192.168.7.37:4548
Configuration number (c#): 11
Feature Flags (ff): Supports Pairing (Flag: 1)
Device ID (id): a8:1b:6a:01:d1:bc
Model Name (md): Smart Bridge 2
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/srv/homeassistant/lib/python3.5/site-packages/homekit/discover.py", line 32, in <module>
    discover_homekit_devices()
  File "/srv/homeassistant/lib/python3.5/site-packages/homekit/zeroconf.py", line 55, in discover_homekit_devices
    print('Protocol Version (pv): {pv}'.format(pv=info.properties[b'pv'].decode()))
KeyError: b'pv'

I added the top print to show the entire contents of info.properties, funny enough all the other devices that show up list a PV.

A simple if b'pv' in info.properties: wrap around that print line solved that particular issue for me.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jlusiardicommented, Apr 30, 2018

Sorry, forgot to push to github. Pypi will follow…

0reactions
sberrymancommented, Apr 30, 2018

I don’t see it merged into master and pushed to pypi?

Read more comments on GitHub >

github_iconTop Results From Across the Web

mDNS resolution not working for iOS devices with app built ...
mDNS resolution is always returning 0 results and throwing an UnobservedTaskException silently for iOS devices (w/ iOS 14.5), when the app ...
Read more >
python-zeroconf API reference
Exception when a service name is already registered. This module provides a framework for the use of DNS Service Discovery using IP multicast....
Read more >
4. Browsing for Services - Zero Configuration Networking
This chapter introduces DNS Service Discovery (DNS-SD), the mechanism in Zeroconf that lets you discover what services are available on the network without ......
Read more >
mdns — User Guide
However, that does not mean it is equally well supported on all platforms. ... Things like the protocol version should be negotiated in-band...
Read more >
Zeroconf API - Spotify for Developers
If any required field is not specified, the response must be an error of ... version, No, String, Spotify client ZeroConf API version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found