Devotics / heatzy-home-hassistant

Climate Home Assistant component for Heatzy Pilot
MIT License
23 stars 20 forks source link

ClimateDevice is deprecated #13

Closed benaisn closed 4 years ago

benaisn commented 4 years ago

Hi there ! Since HA 0.105 (I think but not 100% sure) I got the following warning message :

Logger: homeassistant.components.climate Source: components/climate/init.py:547 Integration: Climate (documentation, issues) First occurred: 11:08:11 AM (2 occurrences) Last logged: 11:08:11 AM

ClimateDevice is deprecated, modify HeatzyPiloteV1Thermostat to extend ClimateEntity ClimateDevice is deprecated, modify HeatzyPiloteV2Thermostat to extend ClimateEntity

froggy974 commented 4 years ago

same for me

Bestchampy commented 4 years ago

hello,

Since few days, I have a same problem with this integration. I update my version with "Devotics-heatzy-home-hassistant-3.1.0-0-g67e37d4" but it doesn't work. Version to home assistant is 0.110.2 and my heatzy is pilot v3.

The errors are this : 2020-06-07 09:32:22 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for heatzy which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant. 2020-06-07 09:32:22 INFO (MainThread) [homeassistant.loader] Loaded heatzy from custom_components.heatzy 2020-06-07 09:32:23 WARNING (MainThread) [homeassistant.components.climate] ClimateDevice is deprecated, modify HeatzyPiloteV1Thermostat to extend ClimateEntity 2020-06-07 09:32:23 WARNING (MainThread) [homeassistant.components.climate] ClimateDevice is deprecated, modify HeatzyPiloteV2Thermostat to extend ClimateEntity

2020-06-07 09:32:29 ERROR (MainThread) [homeassistant.components.climate] Error while setting up heatzy platform for climate Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\homeassistant\helpers\entity_platform.py", line 178, in _async_setup_platform await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT) File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\asyncio\tasks.py", line 483, in wait_for return fut.result() File "C:\Users\user\AppData\Roaming.homeassistant\custom_components\heatzy\climate.py", line 38, in async_setup_platform devices = await api.async_get_devices() File "C:\Users\user\AppData\Roaming.homeassistant\custom_components\heatzy\api.py", line 18, in async_get_devices token = await self._async_get_token() File "C:\Users\user\AppData\Roaming.homeassistant\custom_components\heatzy\api.py", line 14, in _async_get_token return authentication.get('token') AttributeError: 'NoneType' object has no attribute 'get'

Thanks for you help. BestChampy

Bestchampy commented 4 years ago

Hi,

I'm find first solution, I change ClimateDevice by ClimateEntity on files pilote_v1.py and pilote_v2.py but now I have a new problem and search second solution ;) I try

2020-06-07 14:51:27 ERROR (MainThread) [custom_components.heatzy.authenticator] Heatzy API returned HTTP status 400, response <ClientResponse(https://euapi.gizwits.com/app/login) [400 BAD REQUEST]> <CIMultiDictProxy('Allow': 'POST, OPTIONS', 'Content-Language': 'zh-cn', 'Content-Type': 'application/json', 'Date': 'Sun, 07 Jun 2020 12:51:20 GMT', 'Server': 'nginx', 'Vary': 'Accept, Accept-Language', 'Content-Length': '87', 'Connection': 'keep-alive')>

2020-06-07 14:51:27 INFO (MainThread) [homeassistant.components.binary_sensor] Not adding entity Updater because it's disabled 2020-06-07 14:51:29 INFO (MainThread) [homeassistant.setup] Setup of domain onboarding took 1.9 seconds. 2020-06-07 14:51:29 ERROR (MainThread) [homeassistant.components.climate] Error while setting up heatzy platform for climate Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\homeassistant\helpers\entity_platform.py", line 178, in _async_setup_platform await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT) File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\asyncio\tasks.py", line 483, in wait_for return fut.result() File "C:\Users\user\AppData\Roaming.homeassistant\custom_components\heatzy\climate.py", line 38, in async_setup_platform devices = await api.async_get_devices() File "C:\Users\user\AppData\Roaming.homeassistant\custom_components\heatzy\api.py", line 18, in async_get_devices token = await self._async_get_token() File "C:\Users\user\AppData\Roaming.homeassistant\custom_components\heatzy\api.py", line 14, in _async_get_token return authentication.get('token') AttributeError: 'NoneType' object has no attribute 'get'

Thanks Bestchampy

Bestchampy commented 4 years ago

OK, i find the second solution. I needed change configuration.yaml

BEFORE climate: - platform: heatzy username: <your heatzy email> password: <your heatzy password>

AFTER climate: - platform: heatzy username: 'your heatzy email' password: 'your heatzy password'

BestChampy

Dramloc commented 4 years ago

Hi! Thank you all for reporting these issues.

@benaisn @froggy974 #14 has been merged and has fixed these warnings for me.

@Bestchampy Thank you for your time. The issue might have been with some characters in your credentials. I added your fix to the documentation.