home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.82k stars 30.91k forks source link

Hydro-Quebec component fails on startup. #26862

Closed gitmeister closed 5 years ago

gitmeister commented 5 years ago

Home Assistant release with the issue: 0.99.2

Last working Home Assistant release (if known): ~0.97.x

Operating environment (Hass.io/Docker/Windows/etc.): Raspbian

Component/platform: https://www.home-assistant.io/components/hydroquebec/

Description of problem: Fails to initialize.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

# HYDRO-QUEBEC
- platform: hydroquebec
  username: XXXXXXX
  password: XXXXXXX 
  contract: 'XXXXXXX'
  monitored_variables:
  - period_length
  - period_total_bill
  - period_mean_daily_consumption
  - yesterday_total_consumption

Traceback (if applicable):

2019-09-23 12:49:30 WARNING (MainThread) [homeassistant.components.http] Configuring trusted_networks via the http integration has been deprecated. Use the trusted networks auth provider instead. For instructions, see https://www.home-assistant.io/docs/authentication/providers/#trusted-networks
2019-09-23 12:49:45 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform hydroquebec is taking over 10 seconds.
2019-09-23 12:49:52 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform hydroquebec
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/hydroquebec/sensor.py", line 137, in async_setup_platform
    contracts = await hydroquebec_data.get_contract_list()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/hydroquebec/sensor.py", line 207, in get_contract_list
    ret = await self._fetch_data()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/hydroquebec/sensor.py", line 218, in _fetch_data
    await self.client.fetch_data()
  File "/srv/homeassistant/lib/python3.7/site-packages/pyhydroquebec/client.py", line 387, in fetch_data
    daily_data = yield from self._get_daily_data(p_p_id, start_date, end_date)
  File "/srv/homeassistant/lib/python3.7/site-packages/pyhydroquebec/client.py", line 276, in _get_daily_data
    timeout=self._timeout)
  File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/client.py", line 466, in _request
    ssl=ssl, proxy_headers=proxy_headers, traces=traces)
  File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 264, in __init__
    url2 = url.with_query(params)
  File "/srv/homeassistant/lib/python3.7/site-packages/yarl/__init__.py", line 885, in with_query
    new_query = self._get_str_query(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/yarl/__init__.py", line 849, in _get_str_query
    quoter(k) + "=" + quoter(self._query_var(v)) for k, v in query.items()
  File "/srv/homeassistant/lib/python3.7/site-packages/yarl/__init__.py", line 849, in <genexpr>
    quoter(k) + "=" + quoter(self._query_var(v)) for k, v in query.items()
  File "/srv/homeassistant/lib/python3.7/site-packages/yarl/__init__.py", line 827, in _query_var
    "of type {}".format(v, type(v))
TypeError: Invalid variable type: value should be str or int, got None of type <class 'NoneType'>

Additional information:

gitmeister commented 5 years ago

Installed newest release 0.99.3 and it works now.

titilambert commented 5 years ago

Please note: https://github.com/home-assistant/home-assistant/issues/27373#issuecomment-540600142