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

HKDevice Error Randomly Appearing #103103

Closed
dcmeglio opened this issue Oct 31, 2023 · 5 comments · Fixed by Jc2k/aiohomekit#342 or #103123
Closed

HKDevice Error Randomly Appearing #103103

dcmeglio opened this issue Oct 31, 2023 · 5 comments · Fixed by Jc2k/aiohomekit#342 or #103123

Comments

@dcmeglio
Copy link
Contributor

The problem

I haven't found the scenario that causes it, but I keep seeing the following error in my logs:
Unexpected exception from <bound method HKDevice.async_update of <custom_components.homekit_controller.connection.HKDevice object at 0x7f5bccb090>

What version of Home Assistant Core has the issue?

2023.10.0b2

What was the last working version of Home Assistant Core?

2023.9.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

homekit_controller

Link to integration documentation on our website

https://www.home-assistant.io/integrations/homekit_controller/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 114, in _handle_timer_finish
    await task
  File "/config/custom_components/homekit_controller/connection.py", line 804, in async_update
    new_values_dict = await self.get_characteristics(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/homekit_controller/connection.py", line 888, in get_characteristics
    return await self.pairing.get_characteristics(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohomekit/controller/coap/pairing.py", line 197, in get_characteristics
    return await self.connection.read_characteristics(characteristics)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohomekit/controller/coap/connection.py", line 509, in read_characteristics
    return self._read_characteristics_exit(ids, pdu_results)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohomekit/controller/coap/connection.py", line 469, in _read_characteristics_exit
    aid_iid = ids[idx]
              ~~~^^^^^
TypeError: 'set' object is not subscriptable

Additional information

I believe it is caused by this commit,
c3d1db5#diff-d7ac6c88ae3f517aa1ec63eb683726dce2075b8bc44c88ea7eba97850d0a208bL127
-- this was changed to a set

This is passed here https://github.com/home-assistant/core/blob/dev/homeassistant/components/homekit_controller/connection.py#L807

Which calls into https://github.com/Jc2k/aiohomekit/blob/94bc38feb1175160dddcc0206e7175591df09b3f/aiohomekit/controller/coap/connection.py#L505

Which expects a list, not a set.

I do run a modified homekit_controller but from my testing I believe this is in the 2023.10 integration changes

@home-assistant
Copy link

Hey there @Jc2k, @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit_controller) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of homekit_controller can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign homekit_controller Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


homekit_controller documentation
homekit_controller source
(message by IssueLinks)

@bdraco
Copy link
Member

bdraco commented Oct 31, 2023

Please try Jc2k/aiohomekit#342

@dcmeglio
Copy link
Contributor Author

Been running for almost 2 hours. No errors. Looking at my old logs this was happening every 5-10 mins before. I can report back in the morning if you like but I think this fixed it.

@dcmeglio
Copy link
Contributor Author

No errors all night. Think this is good

@bdraco
Copy link
Member

bdraco commented Oct 31, 2023

I'll get it merged and a new release shortly after breakfast

@bdraco bdraco reopened this Oct 31, 2023
bdraco added a commit that referenced this issue Oct 31, 2023
@bdraco bdraco mentioned this issue Oct 31, 2023
20 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Nov 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants