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.

KeyError during discovery

See original GitHub issue

A HA user has reported a KeyError whilst doing discovery. It looks like there might be a feature flag we don’t recognise. Their report is here.

  File "/usr/local/lib/python3.7/site-packages/homekit/controller/controller.py", line 89, in discover
    return discover_homekit_devices(max_seconds)
  File "/usr/local/lib/python3.7/site-packages/homekit/zeroconf_impl/__init__.py", line 102, in discover_homekit_devices
    info.properties
  File "/usr/local/lib/python3.7/site-packages/homekit/zeroconf_impl/__init__.py", line 153, in parse_discovery_properties
    d['flags'] = FeatureFlags[flags]
  File "/usr/local/lib/python3.7/site-packages/homekit/model/feature_flags.py", line 33, in __getitem__
    raise KeyError('Item {item} not found'.format(item=item))
KeyError: 'Item 2 not found'

I have asked what device they are trying to pair.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
jlusiardicommented, Jul 17, 2019

0.15.0 is out for you!

1reaction
Jc2kcommented, Jul 28, 2019

@SimonThoustrup thanks for the comment but that should really go on the HASS ticket I mentioned unless you can reproduce it outside of HASS with the latest homekit_python package.

The fix is in a homekit_python release but it’s not yet in a HASS release, so there’s nothing to do on the homekit_python side.

Read more comments on GitHub >

github_iconTop Results From Across the Web

KeyError in discovery.py · Issue #42 · noxrepo/pox - GitHub
POX throws the following exception when a socket error errno.EWOULDBLOCK is returned: Traceback (most recent call last): File ...
Read more >
Performing google search in python with API, returned with ...
Make sure your configuration for "Custom Search" in your search engine app located at Setup ... Then KeyError exception won't happen.
Read more >
docker_container_mem: crash during discovery: KeyError('stats')
The docker_container_mem section plugin crashed upon output from a container that was running, but did not provide any memory statistics. This may happen...
Read more >
Python KeyError Exceptions and How to Handle Them
The Python KeyError is a type of LookupError exception and denotes that there was an issue retrieving the key you were looking for....
Read more >
Python script depot - getting a KeyError when inputing key ...
When I send a dict of values (taken from a json file) to the score formula, I t ends up with KeyError (as...
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