CoMPaTech / stromer

Stromer custom_component for Home Assistant
MIT License
13 stars 5 forks source link

[BUG]: Onbekende fout! #138

Closed jvanbouchaute closed 1 week ago

jvanbouchaute commented 2 weeks ago

Describe the bug.

When setting up the integration with stromer using my user / pwd & successfully sniffer clientid, I still get an unknown error. See attachment & HA.log

HA is running inside a container (QNAP container station)

What version of Home Assistant Core has the issue?

2024.8.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

How did you install the stromer integration

HACS

Logging

2024-08-30 13:22:55.831 ERROR (MainThread) [custom_components.stromer.stromer] Stromer unable to fetch full data: Session is closed 2024-08-30 13:22:55.831 ERROR (MainThread) [custom_components.stromer.const] Unexpected exception Traceback (most recent call last): File "/config/custom_components/stromer/stromer.py", line 70, in stromer_detect self.full_data = await self.stromer_call_api(endpoint="bike/", full=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/stromer/stromer.py", line 225, in stromer_call_api res = await self._websession.get(url, headers=headers, data={}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 490, in _request raise RuntimeError("Session is closed") RuntimeError: Session is closed

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/config/custom_components/stromer/config_flow.py", line 92, in async_step_user bikes_data = await validate_input(self.hass, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/stromer/config_flow.py", line 42, in validate_input all_bikes = await stromer.stromer_detect() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/stromer/stromer.py", line 74, in stromer_detect raise ApiError from e custom_components.stromer.stromer.ApiError

Diagnostics information

No response

Additional information

image

CoMPaTech commented 2 weeks ago

Strange - I'll look into it, tnx for reporting @jvanbouchaute

CoMPaTech commented 1 week ago

Looking with fresh eyes, this might be a 'too early' close of the connection during setup that was introduced lately. If everything runs fine in #140 I'll make a pre-release out of that for you to test!

CoMPaTech commented 1 week ago

Will you be able to test https://github.com/CoMPaTech/stromer/releases/tag/v0.4.1b1 ?

jvanbouchaute commented 1 week ago

Hi Tom,

thanks for the fix. It indeed now works !

Op do 5 sep 2024 om 21:03 schreef Tom @.***>:

Will you be able to test https://github.com/CoMPaTech/stromer/releases/tag/v0.4.1b1 ?

— Reply to this email directly, view it on GitHub https://github.com/CoMPaTech/stromer/issues/138#issuecomment-2332442215, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR24KDHP4IFVLGPDVO6HN3ZVCTGZAVCNFSM6AAAAABNMJJCWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZSGQ2DEMRRGU . You are receiving this because you were mentioned.Message ID: @.***>

-- Met vriendelijke groeten.

Jurgen Van Bouchaute

CoMPaTech commented 1 week ago

Tnx for testing, releasing :)