JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
1.13k stars 89 forks source link

Bug: __init__() missing 1 required positional argument: 'loop' #74

Closed vaidyasr closed 3 years ago

vaidyasr commented 3 years ago

Describe the bug When trying to add a new device through the HASS (Python 3.8.8), the component throws an error. image

To Reproduce Steps to reproduce the behavior:

  1. Go to HASS Integrations
  2. Add Tapo integration
  3. Enter the required data (IP, Credentials) and submit
  4. See error

Expected behavior To successfully add the device.

Log When trying to add device. 2021-03-02 22:39:02 ERROR (MainThread) [custom_components.tapo_control] __init__() missing 1 required positional argument: 'loop'

Camera (please complete the following information):

Using stream component NA

Camera works through onvif component OR different cameras work in general NA

Camera has all attributes filled out properly in developer tools NA

HASS Environment Python 3.8.8 venv on raspberry pi 4

Additional context When using the pytapo module directly from Python, it seems to work.

>>> from pytapo import Tapo
>>> user = "camera"
>>> password = "XXXX"
>>> host = "192.168.1.21"
>>> tapo = Tapo(host, user, password)
>>> print(tapo.getBasicInfo())
{'device_info': {'basic_info': {'device_type': 'SMART.IPCAMERA', 'device_model': 'C200', 'device_name': 'C200 1.0', 'device_info': 'C200 1.0', 'hw_version': '1.0', 'sw_version': '1.0.17 Build 201111 Rel.74534n(5553)', 'device_alias': 'Parking Camera', 'features': '3', 'barcode': '', 'mac': 'XXXX', 'dev_id': 'XXXX', 'oem_id': 'XXXX', 'hw_desc': 'XXXX'}}, 'error_code': 0}
vaidyasr commented 3 years ago

This issue can be closed. I have disabled all custom_components and now it is working. Will find out the one which is causing this issue. Thanks for your time.