Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Attempt to decode JSON with unexpected mimetype" when trying to turn on device #7

Open
trancefam opened this issue Jan 23, 2021 · 0 comments

Comments

@trancefam
Copy link

Version of the custom_component

0.2.4

Configuration

None

Describe the bug

I receive the below error when trying to turn on the imported devices that were already off. I have confirmed that turning off and turning on devices that were already on work fine. I am running the latest version of HA and latest version of LedFx (v11.1).

e.g. The issue happens for all with the X below:

image

Debug log


[140297667665728] 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('http://MYURLandPORT/api/devices/wled6/effects')
[140297667665728] 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('http://MYURLandPORT/api/devices/stool/effects')
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1445, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 593, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 664, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 630, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 230, in async_handle_light_on_service
    await light.async_turn_on(**params)
  File "/config/custom_components/ledfxrm/light.py", line 149, in async_turn_on
    await self.coordinator.api.async_device_on(self.devicename)
  File "/config/custom_components/ledfxrm/__init__.py", line 418, in async_device_on
    await set_effect.json()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1097, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('http://MYURLandPORT/api/devices/wled6/effects')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant