petretiandrea / home-assistant-tapo-p100

A custom integration to control Tapo devices from home assistant.
MIT License
759 stars 96 forks source link

HA log filled with tapo discovery error #728

Closed jerry34ha closed 1 month ago

jerry34ha commented 2 months ago

Version of the integration

3.0.0

Configuration

I have P100, P110, P300 and L510 devices that seems to work well within HA.

HA core 2024.2.5 HA OS 12.1 Running on HA Green. Same problem with 2024.3.0.

P100 firmware: 1.2.1 build 230804 Real.190922

Add your logs here.

Describe the bug

Every 10 minutes, the following error is logged in the HA log. Enabled debug logging does not produce more logs.

Debug log


2024-03-15 21:19:10.057 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/tapo/__init__.py", line 45, in _start_discovery
    if device_found := await discovery_tapo_devices(hass):
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tapo/discovery.py", line 29, in discovery_tapo_devices
    for device in chain(*await asyncio.gather(*discovery_tasks))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tapo/discovery.py", line 21, in <lambda>
    lambda: list(
            ^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/discovery/tapo_discovery.py", line 128, in scan
    yield DiscoveredDevice.from_dict(x)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/plugp100/discovery/discovered_device.py", line 33, in from_dict
    mgt_encrypt_schm=EncryptionScheme(**values.get("mgt_encrypt_schm")),
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: plugp100.discovery.discovered_device.EncryptionScheme() argument after ** must be a mapping, not NoneType
jerry34ha commented 2 months ago

This happens on HA Green but not a UTM VM. The HA Green install is a backup of the UTM VM.

Both installations are HA Core 2024.2.5 Supervisor 2024.3.0 HA OS 12.1

joemcc-90 commented 2 months ago

I have the exact same, integration appears to work ok, but below error coming in logs a lot

Logger: homeassistant Source: custom_components/tapo/discovery.py:21 integration: TP-Link Tapo (documentation, issues) First occurred: 03:00:38 (41 occurrences) Last logged: 09:30:37

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/tapo/init.py", line 45, in _start_discovery if device_found := await discovery_tapo_devices(hass): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo/discovery.py", line 29, in discovery_tapo_devices for device in chain(await asyncio.gather(discovery_tasks)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo/discovery.py", line 21, in lambda: list( ^^^^^ File "/usr/local/lib/python3.12/site-packages/plugp100/discovery/tapo_discovery.py", line 128, in scan yield DiscoveredDevice.from_dict(x) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/plugp100/discovery/discovered_device.py", line 33, in from_dict mgt_encrypt_schm=EncryptionScheme(values.get("mgt_encrypt_schm")), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: plugp100.discovery.discovered_device.EncryptionScheme() argument after ** must be a mapping, not NoneType

liamlain commented 1 month ago

same error here:

This error originated from a custom integration.

Logger: homeassistant Source: custom_components/tapo/discovery.py:21 integration: TP-Link Tapo (documentation, issues) First occurred: April 4, 2024 at 5:51:46 PM (105 occurrences) Last logged: 11:11:46 AM

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/tapo/init.py", line 45, in _start_discovery if device_found := await discovery_tapo_devices(hass): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo/discovery.py", line 29, in discovery_tapo_devices for device in chain(await asyncio.gather(discovery_tasks)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo/discovery.py", line 21, in lambda: list( ^^^^^ File "/usr/local/lib/python3.12/site-packages/plugp100/discovery/tapo_discovery.py", line 128, in scan yield DiscoveredDevice.from_dict(x) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/plugp100/discovery/discovered_device.py", line 33, in from_dict mgt_encrypt_schm=EncryptionScheme(values.get("mgt_encrypt_schm")), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: plugp100.discovery.discovered_device.EncryptionScheme() argument after ** must be a mapping, not NoneType

petretiandrea commented 1 month ago

Fixed by 3.1.0