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

[BUG] aiohttp deflate error #23

Closed
bouwew opened this issue Sep 7, 2020 · 2 comments
Closed

[BUG] aiohttp deflate error #23

bouwew opened this issue Sep 7, 2020 · 2 comments
Assignees

Comments

@bouwew
Copy link
Contributor

bouwew commented Sep 7, 2020

Describe the bug
Error when adding the integration for the Stretch.

Evidence

2020-08-21 23:20:18 ERROR (MainThread) [custom_components.plugwise.config_flow] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/plugwise/config_flow.py", line 130, in async_step_user
    api = await validate_input(self.hass, user_input)
  File "/config/custom_components/plugwise/config_flow.py", line 74, in validate_input
    await api.connect()
  File "/usr/local/lib/python3.8/site-packages/Plugwise_Smile/Smile.py", line 161, in connect
    result = await resp.text()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1009, in text
    await self.read()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 973, in read
    self._body = await self.content.read()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/streams.py", line 358, in read
    block = await self.readany()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/streams.py", line 380, in readany
    await self._wait('readany')
  File "/usr/local/lib/python3.8/site-packages/aiohttp/streams.py", line 296, in _wait
    await waiter
aiohttp.client_exceptions.ClientPayloadError: 400, message='Can not decode content-encoding: deflate'

Home Assistant Core (please complete the following information):

  • Version: 0.114.3
  • Deployment: hassio
  • Installed plugwise version: plugwise-beta pre-v0.7.0a0 code
  • Installed through: HACS

Smile (please complete the following information):

  • Sort of Smile: Stretch v2
  • Firmware: 2.3.12

Additional context
Adding this: headers = {'Accept-Encoding': 'gzip'} make the error go away.

@bouwew
Copy link
Contributor Author

bouwew commented Sep 7, 2020

Investigation shows that this is indeed an existing aiohttp-error.
There are pull-request in the master-branch fixing this error.

Solutions:

  1. a temporary work-around using headers = {'Accept-Encoding': 'gzip'} in Plugwise_Smile, implemented in v1.4.0
  2. use aiohttp > 3.6.2 when available

@CoMPaTech CoMPaTech transferred this issue from plugwise/Plugwise-Smile Oct 25, 2020
@bouwew bouwew self-assigned this Feb 5, 2021
@bouwew
Copy link
Contributor Author

bouwew commented Feb 5, 2021

After HA Core has been upgraded to aiohttp v3.7.2 the error is gone but the integration still doesn't work.
There is no error-information that points to aiohttp, only a plugwise-timeout error is shown.

Therefore the temporary work-around has been made a permanent addition to the plugwise-code.

@bouwew bouwew closed this as completed Feb 5, 2021
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