Open WhimsySpoon opened 4 weeks ago
Exception appears slightly different in 0.6.0:
[139853489545296] Unexpected exception
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/signalrgb/client.py", line 130, in _request
response.raise_for_status()
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://[hostname]:16038/api/v1/lighting/enabled
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 974, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/simplejson/__init__.py", line 514, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 386, in decode
obj, end = self.raw_decode(s)
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/simplejson/decoder.py", line 416, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/signalrgb/client.py", line 373, in enabled
response_data = self._request(
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/signalrgb/client.py", line 146, in _request
error_data = e.response.json().get("errors", [{}])[0]
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 978, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 626, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/config/custom_components/signalrgb/light.py", line 184, in async_turn_on
await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/signalrgb/client.py", line 379, in enabled
raise SignalRGBException(
signalrgb.client.SignalRGBException: Failed to set enabled state: Expecting value: line 1 column 1 (char 0)
Do you have the latest SignalRGB? The enabled and brightness states were just added a week ago, and they don't give us a way to determine the version easily from the API.
Looks like it was added in the beta. I'm running the latest stable, so might explain this.
Control Global brightness with Macros and the local API.
Will update to the beta and report back...
Oh geez yeah it's the beta. Sorry about that, I've just got automatic updates on!
I might be able to figure out the right behavior based on whether these properties even exist in the json responses, I'll have a peek after work today. Also grab 0.6.1, it fixes a nasty state tracking issue
Please don't apologise! This integration is amazing!!
I gave just installed the beta and 0.6.0 and 0.6.1 is now working perfectly - thank you!
Additionally, Brightness and on/off work without the need for the Good Night!
effect.
I don't know how frequently SignalRGB promotes beta releases, but if it's likely to take a while, I'd be happy to submit a PR for the readme.md confirming that the beta is required to save the need for potential spaghetti code to handle the API version differences.
Yeah that would be great, but it probably needs to adapt to different SignalRGB versions anyway so I'll still dig into it.
Have you tried hyper-light-card yet? I just made the first release!
PR for an updated readme is with you.
I have tried the new card and it's amazing!
Any commands from Home Assistant Core throw the exception below.
:16038/api/v1/lighting
:The exception: