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 fails to load #9

Open
thomascandrian opened this issue Jul 1, 2024 · 1 comment
Open

Integration fails to load #9

thomascandrian opened this issue Jul 1, 2024 · 1 comment

Comments

@thomascandrian
Copy link

I'm not really sure what is going wrong here...

login_step2 = await self._session.post(self._url, data=login_check_data)
        text = await login_step2.text()
        _LOGGER.debug(f"Step 2 returned status code: {login_step2.status}, text: {text}")

        if 'OK' not in text:
            _LOGGER.warn("OK not found in login step 2")
            if is_retry:
                raise Exception("Login failed: %s" % login_step2.text)
            await self._login(is_retry=True)
        
        _LOGGER.debug("Logged in successfully")

Login semms fine, and it looks like there IS a OK in the response text (see below), but it is not recognized. I tried to remove the code which checks the login, but it fails with the html parser. Maybe the device response did change in recent updates?

2024-07-01 20:48:31.718 ERROR (MainThread) [homeassistant.components.switch] Error while setting up zyxel_poe platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/zyxel_poe/switch.py", line 79, in async_setup_platform
await poe_data.async_update()
File "/config/custom_components/zyxel_poe/switch.py", line 220, in _async_update
await self._login()
File "/config/custom_components/zyxel_poe/switch.py", line 166, in _login
await self._login(is_retry=True)
File "/config/custom_components/zyxel_poe/switch.py", line 165, in _login
raise Exception("Login failed: %s" % login_step2.text)
Exception: Login failed: <bound method ClientResponse.text of <ClientResponse(http://10.0.11.2/cgi-bin/dispatcher.cgi) [200 OK]>
<CIMultiDictProxy('Date': 'Mon, 01 Jul 2024 18:48:31 GMT', 'Server': 'Hydra/0.1.8', 'Accept-Ranges': 'bytes', 'Connection': 'close', 'Content-Security-Policy': "default-src 'self';script-src 'self' 'unsafe-inline' 'unsafe-eval';style-src 'self' 'unsafe-inline'; base-uri 'self'")>
>

Model Name: | GS1900-8HP
Revision: | B1
Firmware Version: | V2.60(AAHI.4) | 05/24/2021

@quizzical86
Copy link

Try upgrading your firmware to V2.70 or 2.80

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

2 participants