krocat / ToonHA

Home-Assistant component for Toon by Eneco

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conflict with other HA module

reinder83 opened this issue · comments

Hi,

I seems I cannot use this custom_module alongside with the synology camera module, it gives me the following error:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/lib/python3.5/asyncio/coroutines.py", line 210, in coro
    res = func(*args, **kw)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/camera/synology.py", line 55, in async_setup_platform
    timeout=timeout
  File "/srv/homeassistant/lib/python3.5/site-packages/synology/surveillance_station.py", line 12, in __init__
    self._api = Api(url, username, password, timeout, verify_ssl)
  File "/srv/homeassistant/lib/python3.5/site-packages/synology/api.py", line 59, in __init__
    self._initialize_api_info()
  File "/srv/homeassistant/lib/python3.5/site-packages/synology/api.py", line 70, in _initialize_api_info
    payload)
  File "/srv/homeassistant/lib/python3.5/site-packages/synology/api.py", line 192, in _get_json_with_retry
    return self._get_json(url, payload)
  File "/srv/homeassistant/lib/python3.5/site-packages/synology/api.py", line 198, in _get_json
    response = self._get(url, payload)
  File "/srv/homeassistant/lib/python3.5/site-packages/synology/api.py", line 185, in _get
    verify=self._verify_ssl)
TypeError: _patched_request() takes 2 positional arguments but 3 were given

After investigating where error comes from I see it's inside the toonapilib
https://github.com/costastf/toonapilib/blob/master/toonapilib/toonapilib.py#L247

Is there a way to fix this?

Same issue here..

@reinder83 did you find any solution?

I am not using this custom module anymore at the moment, the default toon module for HA started working again for me

Are you sure? Toon/Eneco disabled the (old) API a few days ago, and that API is used by the default Toon module in HA, see: home-assistant/core#21010

Hmm you are right, it seems it's not updating anymore, so yeah would be nice if this issue gets fixed

Hi @reinder83 ,sorry this completely fell through the cracks. I will fix the issue of the monkey patched version during the weekend.

This should be properly handled by v3.0.4 of the library. Apologies for missing this for so long.

@costastf Issue is still there after updating to 3.0.4

toonapilib in /usr/local/lib/python3.7/site-packages (3.0.4)

2019-02-21 15:16:04 ERROR (MainThread) [homeassistant.components.camera] Error while setting up platform synology
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/src/app/homeassistant/components/camera/synology.py", line 53, in async_setup_platform
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/synology/surveillance_station.py", line 12, in __init__
    self._api = Api(url, username, password, timeout, verify_ssl)
  File "/usr/local/lib/python3.7/site-packages/synology/api.py", line 59, in __init__
    self._initialize_api_info()
  File "/usr/local/lib/python3.7/site-packages/synology/api.py", line 70, in _initialize_api_info
    payload)
  File "/usr/local/lib/python3.7/site-packages/synology/api.py", line 192, in _get_json_with_retry
    return self._get_json(url, payload)
  File "/usr/local/lib/python3.7/site-packages/synology/api.py", line 198, in _get_json
    response = self._get(url, payload)
  File "/usr/local/lib/python3.7/site-packages/synology/api.py", line 185, in _get
    verify=self._verify_ssl)
TypeError: _patched_request() takes 2 positional arguments but 3 were given