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

Integration broken #152

Open
menloperk opened this issue Nov 6, 2024 · 5 comments
Open

Integration broken #152

menloperk opened this issue Nov 6, 2024 · 5 comments
Assignees

Comments

@menloperk
Copy link

This error originated from a custom integration.

Logger: custom_components.alfen_wallbox
Source: custom_components/alfen_wallbox/init.py:96
integration: Alfen Wallbox (documentation)
First occurred: 12:51:20 PM (1 occurrences)
Last logged: 12:51:20 PM

Unexpected error creating device 192.168.1.51 'Timeout' object does not support the context manager protocol

@menloperk
Copy link
Author

Upgraded to 2.8.10 but that didn't help. Integration remains broken...

@menloperk
Copy link
Author

menloperk commented Nov 6, 2024

OK, fixed it. Please use asyncio instead of async_timeout.
So 2 files need to be fixed: __init__.py and config_flow.py

  1. Please comment out this line in both files:
    #from async_timeout import timeout
  2. In both files change this line:
    # with timeout(TIMEOUT):
    to:
    async with asyncio.timeout(TIMEOUT):

After this, restart HA and things should be working again...
Who can apply this in the code and release a new version?

@menloperk
Copy link
Author

Put in 2 pull requests now for this fix...

@leeyuentuen
Copy link
Owner

I'll later check on it

@leeyuentuen leeyuentuen reopened this Nov 6, 2024
@leeyuentuen leeyuentuen self-assigned this Nov 6, 2024
@Raouzer
Copy link

Raouzer commented Nov 12, 2024

OK, fixed it. Please use asyncio instead of async_timeout. So 2 files need to be fixed: init.py and config_flow.py

  1. Please comment out this line in both files:
    #from async_timeout import timeout
  2. In both files change this line:
    # with timeout(TIMEOUT):
    to:
    async with asyncio.timeout(TIMEOUT):

After this, restart HA and things should be working again... Who can apply this in the code and release a new version?

Hi,

Same issue here. That fix as also working for me.

Thanks

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

No branches or pull requests

3 participants