koying / openrgb_ha

OpenRGB integration for Home Assistant
110 stars 18 forks source link

Error when trying to apply Effect #12

Closed cvroque closed 3 years ago

cvroque commented 3 years ago

Hello, first of all, thanks for this awesome integration!

I've an issue when trying to apply effects through the UI:

image

The only mode that is applied through HA correctly is "Direct", while the others (Breathing, Color Cycle) work normally in OpenRGB itself. Below is the log error, unfortunately it's beyond me to figure out the problem:

Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/openrgb/light.py:310 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 22:25:04 (1 occurrences) Last logged: 22:25:04

[139967665461568] '<=' not supported between instances of 'NoneType' and 'NoneType' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1492, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1527, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 843, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/light/init.py", line 462, in async_handle_light_on_service await light.async_turn_on(filter_turn_on_params(light, params)) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 895, in async_turn_on await self.hass.async_add_executor_job(ft.partial(self.turn_on, kwargs)) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, self.kwargs) File "/config/custom_components/openrgb/light.py", line 162, in turn_on self._device_turned_on(kwargs) File "/config/custom_components/openrgb/light.py", line 286, in _device_turned_on self._set_effect() File "/config/custom_components/openrgb/light.py", line 310, in _set_effect self._light.set_mode(self._effect) File "/usr/local/lib/python3.9/site-packages/openrgb/orgb.py", line 231, in set_mode data = mode.pack(self.comms._protocol_version) File "/usr/local/lib/python3.9/site-packages/openrgb/utils.py", line 276, in pack self.validate() File "/usr/local/lib/python3.9/site-packages/openrgb/utils.py", line 256, in validate assert self.brightness_min <= self.brightness <= self.brightness_max TypeError: '<=' not supported between instances of 'NoneType' and 'NoneType'

koying commented 3 years ago

Are you running OpenRGB "experimental"? Ah no, you're actually likely running stable

Seems there is a bug in the the component supporting library with the new protocol introduced in ORGB v0.7

cvroque commented 3 years ago

~Are you running OpenRGB "experimental"?~ Ah no, you're actually likely running stable

Seems there is a bug in the the component supporting library with the new protocol introduced in ORGB v0.7

Hello! Sorry, looking now I really didn't give you much info to work with.

Home Assistant: v2021.9.7 OpenRGB: v0.6 installed on Windows 10 OpenRGB_HA: v2.0 through HACS

Would you recommend me to run v07 experimental or maybe downgrade this component version?

Thanks in advance

koying commented 3 years ago

Reverting to v1.1 is likely to fix that issue ;)

cvroque commented 3 years ago

Reverting to v1.1 is likely to fix that issue ;)

v1.1 still caused issues, but I tried v1.0 and it's working normally, thanks for the help!

I guess whenever v0.7 of OpenRGB comes out I'll also update the add-on and try out.