Pyhass / Hive-Custom-Component

A custom version of the home assistant hive component
MIT License
33 stars 17 forks source link

[BUG] Invalid type for parameter AuthParameters #134

Closed adamnmcc closed 1 year ago

adamnmcc commented 2 years ago

Describe the bug when setting the Component up, the Logs show an error of an incorrect data type returned from the hive API

To Reproduce Steps to reproduce the behaviour:

setup Hive Component in Home-Assistant and check logs

Expected behaviour the Component should setup correctly.

Screenshots image image

Desktop (please complete the following information):

Additional context `This error originated from a custom integration.

Logger: homeassistant.config_entries Source: custom_components/hive/init.py:89 Integration: Hive First occurred: 12:43:22 (1 occurrences) Last logged: 12:43:22

Error setting up entry adam@mccartney.ie for hive Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/hive/init.py", line 89, in async_setup_entry devices = await hive.session.startSession(hive_config) File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 503, in startSession await self.getDevices("No_ID") File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 426, in getDevices await self.hiveRefreshTokens() File "/usr/local/lib/python3.10/site-packages/apyhiveapi/session.py", line 304, in hiveRefreshTokens result = await self.auth.refresh_token( File "/usr/local/lib/python3.10/site-packages/apyhiveapi/api/hive_auth_async.py", line 548, in refresh_token result = await self.loop.run_in_executor( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 391, in _api_call return self._make_api_call(operation_name, kwargs) File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 691, in _make_api_call request_dict = self._convert_to_request_dict( File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 739, in _convert_to_request_dict request_dict = self._serializer.serialize_to_request( File "/usr/local/lib/python3.10/site-packages/botocore/validate.py", line 360, in serialize_to_request raise ParamValidationError(report=report.generate_report()) botocore.exceptions.ParamValidationError: Parameter validation failed: Invalid type for parameter AuthParameters, value: ({'REFRESH_TOKEN': '[REDACTED]'},), type: <class 'tuple'>, valid types: <class 'dict'> `

KJonline commented 2 years ago

@adamnmcc have you got 2fa switched on and have you logged out of the hive app and logged back in recently?

adamnmcc commented 1 year ago

no, i haven't got 2fa enabled.. no, but i can if you think it will help..

i assume you mean the app on my phone?

KJonline commented 1 year ago

Ye it will and yes the hive app on your phone.

Enable 2fa Logout of your hive app on your phone Log back into the hive app on your phone Login to the home assistant hive integration.

adamnmcc commented 1 year ago

perfect, that worked. Many thanks!!