petrleocompel / hikaxpro_hacs

HACS repository of Hikvision Ax Pro integration for home assistant
MIT License
46 stars 5 forks source link

Unable to setup plugin (Invalid Authentication) - Latest version #75

Closed stickmanbrad closed 1 year ago

stickmanbrad commented 1 year ago

Version of plugin: v2.1.0-beta10

Please can you help? I’m trying to configure the plugin after adding it through HACS. My system is an AX PRO. I’ve confirmed username and password is the only one and is administration role. I have checked it logs in through the IP’s web client. But when setting up through HA I just get ‘Invalid Authentication’.

Logs below:

This error originated from a custom integration.

Logger: custom_components.hikvision_axpro.config_flow
Source: custom_components/hikvision_axpro/config_flow.py:178
Integration: hikvision_axpro
First occurred: 21:59:33 (1 occurrences)
Last logged: 21:59:33

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/hikvision_axpro/hikax/hikax.py", line 38, in get_session_params
    session_cap = self.parse_session_response(response.text)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/hikvision_axpro/hikax/hikax.py", line 66, in parse_session_response
    session_cap = SessionLoginCap.SessionLoginCap(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: SessionLoginCap.__init__() missing 1 required positional argument: 'session_id_version'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/hikvision_axpro/config_flow.py", line 178, in async_step_user
    info = await validate_input(self.hass, user_input)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/hikvision_axpro/config_flow.py", line 151, in validate_input
    if not await hub.authenticate():
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/hikvision_axpro/config_flow.py", line 116, in authenticate
    is_connect_success = await self.hass.async_add_executor_job(self.axpro.connect)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/hikvision_axpro/hikax/hikax.py", line 93, in connect
    params = self.get_session_params()
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/hikvision_axpro/hikax/hikax.py", line 41, in get_session_params
    raise errors.IncorrectResponseContentError()
errors.errors.IncorrectResponseContentError: Response content is not in expected form.

Kind Regards in advanced.