core: Onkyo unable to connect (2023.5.0+)

The problem

Onkyo reporting unable to connect to receiver in the new 2023.5.0b0, while working fine when downgrading back to 2023.4.6.

See error reported below.

What version of Home Assistant Core has the issue?

core-2023.5.0b0

What was the last working version of Home Assistant Core?

core-2023.4.6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Onkyo

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

media_player:
  - platform: onkyo
    host: 192.168.30.122
    name: Game Room Receiver
    sources:
      bd-dvd: 'Fire TV'
      tv-cd: 'TV'

Anything in the logs that might be useful for us?

2023-04-27 13:27:21.136 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.game_room_receiver fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 554, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in async_device_update
    await coro
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/onkyo/media_player.py", line 295, in update
    status = self.command("system-power query")
  File "/usr/src/homeassistant/homeassistant/components/onkyo/media_player.py", line 282, in command
    result = self._receiver.command(command)
  File "/usr/local/lib/python3.10/site-packages/eiscp/core.py", line 480, in command
    response = self.raw(iscp_message)
  File "/usr/local/lib/python3.10/site-packages/eiscp/core.py", line 470, in raw
    return filter_for_message(self.get, iscp_message)
  File "/usr/local/lib/python3.10/site-packages/eiscp/core.py", line 260, in filter_for_message
    candidate = getter_func(0.05)
  File "/usr/local/lib/python3.10/site-packages/eiscp/core.py", line 443, in get
    ready = select.select([self.command_socket], [], [], timeout or 0)
TypeError: argument must be an int, or have a fileno() method.

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 5
  • Comments: 21 (16 by maintainers)

Commits related to this issue

Most upvoted comments

@shbatm It looks like I broke the parallel updates locking in that commit. I’m not sure if that will fix this case though. I’m working on a solution now.

    except (ValueError, OSError, AttributeError, AssertionError):
        if self._receiver.command_socket:
            self._receiver.command_socket = None

That code in the integration looks a bit suspect

This looks like it just resets the command socket in an abstract way… The package looks for a valid socket and if it’s None then it sets up a new one:

https://github.com/miracle2k/onkyo-eiscp/blob/f570239f5a0a2eadbadb8b0f01f7cdbfc3a96d04/eiscp/core.py#L475