GithubHelp home page GithubHelp logo

Comments (3)

Garulf avatar Garulf commented on June 21, 2024

I changed line 196 to:

id = parts[0]

and it seems to be working fine now.
hue_target = self._huesyncbox.api.execution.hue_target
was returning a list with one item. Similar to this: ['47XX285f-XXXX-492e-XXXX-51bXXXXa590c']

So string split was not affecting anything and a one item list was being returned.

Looks like the 'Set_entertainment_area" service fails now however....

with this error:

Error log
2021-05-14 03:23:00 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 15: Invalid Value
Traceback (most recent call last):
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 363, in _async_step
    await getattr(self, handler)()
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 563, in _async_call_service_step
    await service_task
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/homeassistant/core.py", line 1481, in async_call
    task.result()
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/homeassistant/core.py", line 1516, in _execute_service
    await handler.job.target(service_call)
  File "/Volumes/HomeAssistant/custom_components/huesyncbox/__init__.py", line 171, in async_set_entertainment_area
    await entry.entity.async_select_entertainment_area(call.data.get(ATTR_ENTERTAINMENT_AREA))
  File "/Volumes/HomeAssistant/custom_components/huesyncbox/media_player.py", line 173, in async_select_entertainment_area
    await self._huesyncbox.api.execution.set_state(hue_target=group.id)
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/aiohuesyncbox/execution.py", line 155, in set_state
    await self._put(data)
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/aiohuesyncbox/execution.py", line 35, in _put
    await self._request('put', '/execution', data=data)
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/aiohuesyncbox/huesyncbox.py", line 185, in request
    _raise_on_error(data)
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/aiohuesyncbox/huesyncbox.py", line 195, in _raise_on_error
    raise_error(data['code'], data["message"])
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/aiohuesyncbox/errors.py", line 38, in raise_error
    raise cls("{}: {}".format(code, message))
aiohuesyncbox.errors.RequestError: 15: Invalid Value
2021-05-14 03:23:00 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [4684096176] Error handling message: Unknown error
Traceback (most recent call last):
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/homeassistant/components/websocket_api/decorators.py", line 21, in _handle_async_response
    await func(hass, connection, msg)
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/homeassistant/components/websocket_api/commands.py", line 482, in handle_execute_script
    await script_obj.async_run(msg.get("variables"), context=context)
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 1209, in async_run
    await asyncio.shield(run.async_run())
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 345, in async_run
    await self._async_step(log_exceptions=False)
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 363, in _async_step
    await getattr(self, handler)()
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 563, in _async_call_service_step
    await service_task
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/homeassistant/core.py", line 1481, in async_call
    task.result()
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/homeassistant/core.py", line 1516, in _execute_service
    await handler.job.target(service_call)
  File "/Volumes/HomeAssistant/custom_components/huesyncbox/__init__.py", line 171, in async_set_entertainment_area
    await entry.entity.async_select_entertainment_area(call.data.get(ATTR_ENTERTAINMENT_AREA))
  File "/Volumes/HomeAssistant/custom_components/huesyncbox/media_player.py", line 173, in async_select_entertainment_area
    await self._huesyncbox.api.execution.set_state(hue_target=group.id)
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/aiohuesyncbox/execution.py", line 155, in set_state
    await self._put(data)
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/aiohuesyncbox/execution.py", line 35, in _put
    await self._request('put', '/execution', data=data)
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/aiohuesyncbox/huesyncbox.py", line 185, in request
    _raise_on_error(data)
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/aiohuesyncbox/huesyncbox.py", line 195, in _raise_on_error
    raise_error(data['code'], data["message"])
  File "/Volumes/HomeAssistant/.venv/lib/python3.9/site-packages/aiohuesyncbox/errors.py", line 38, in raise_error
    raise cls("{}: {}".format(code, message))
aiohuesyncbox.errors.RequestError: 15: Invalid Value

from huesyncbox.

mvdwetering avatar mvdwetering commented on June 21, 2024

There seem to be some API updates on the box.
I had already been working on some other fixes and improvements for this integration and the first one was already solved when I simplified some code. I just also fixed the second issue you mentioned.

I tagged version 1.11.0 which should be available soon. Could you check if that solves the issues?

EDIT: release is available now

from huesyncbox.

Garulf avatar Garulf commented on June 21, 2024

I can confirm no errors and everything works beautifully after updating to 1.11.0.

Thank you!

from huesyncbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.