jath03 / openrgb-python

A python client for the OpenRGB SDK
GNU General Public License v3.0
112 stars 22 forks source link

Issues connecting through Home Assistant instance running on TrueNAS #30

Closed RevolverUnit closed 3 years ago

RevolverUnit commented 3 years ago

Trying to set up OpenRGB integration for Home Assistant but get a connection error.

Opened a ticket here and the developer suggested I post the issue here as well.

System Info: version core-2021.4.6
installation_type Home Assistant Core
dev false
hassio false
docker false
virtualenv true
python_version 3.8.9
os_name FreeBSD
os_version 12.2-RELEASE-p3
arch amd64

Log entry:

Traceback (most recent call last):
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/auth.py", line 135, in auth_middleware
    return await handler(request)
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/view.py", line 131, in handle
    result = await result
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/homeassistant/components/config/config_entries.py", line 155, in post
    return await super().post(request, flow_id)
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/homeassistant/components/http/data_validator.py", line 60, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/data_entry_flow.py", line 107, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/homeassistant/data_entry_flow.py", line 156, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/homeassistant/data_entry_flow.py", line 214, in _async_handle_step
    result: dict = await getattr(flow, method)(user_input)
  File "/home/homeassistant/homeassistant/custom_components/openrgb/config_flow.py", line 76, in async_step_user
    await asyncio.wait_for(
  File "/usr/local/lib/python3.8/asyncio/tasks.py", line 494, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/homeassistant/custom_components/openrgb/config_flow.py", line 24, in _try_connect
    conn = OpenRGBClient(_host, _port, name=_client_id)
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/openrgb/orgb.py", line 263, in __init__
    self.comms = NetworkClient(self._callback, address, port, name, protocol_version)
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/openrgb/network.py", line 42, in __init__
    self.start_connection()
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/openrgb/network.py", line 64, in start_connection
    self.send_header(0, utils.PacketType.REQUEST_PROTOCOL_VERSION, struct.calcsize('I'))
  File "/usr/local/share/homeassistant/lib/python3.8/site-packages/openrgb/network.py", line 204, in send_header
    sent = self.sock.send(data, NOSIGNAL)
NameError: name 'NOSIGNAL' is not defined
jath03 commented 3 years ago

Ah. You're apparently the first person using this library with FreeBSD. 656ef7659540435ff49dae28ef73dad9de84695d should fix this. Can you update openrgb-python to the latest git version (as shown in the readme) in the virtualenv that HA is using and verify that this fixes it?

jath03 commented 3 years ago

Just waiting on @koying to update the openrgb-python version included in the integration. I'll keep this open until then

koying commented 3 years ago

I've bumped the integration with version 0.2.10. Thx