willemwouters / localtuya_synced

local handling for Tuya devices, clone with: git clone --recursive https://github.com/willemwouters/localtuya_synced.git and follow manual installation steps
GNU General Public License v3.0
5 stars 3 forks source link

RuntimeWarning after adding multiple devices #6

Open TheKamakaZi opened 1 year ago

TheKamakaZi commented 1 year ago

The problem

After successfully adding multiple RGBCW bulbs that use 3.4, I keep running into this warning in my log:

/config/custom_components/localtuya/common.py:384: RuntimeWarning: coroutine 'TuyaProtocol.close' was never awaited
  self._interface.close()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Environment

Steps to reproduce

  1. Added 1 RGBCW bulb
  2. Added 1 Smart Socket (3.3)
  3. Added 7 additional RGBCW bulbs
  4. After adding the 8th bulb, I begin to receive the above-mentioned error.
  5. Reloading using Developer Tools -> LOCALTUYA INTEGRATION results in the following error, once or multiple times:
    2023-01-02 01:08:48.026 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry localtuya for light
    Traceback (most recent call last):
    File "/usr/src/homeassistant/homeassistant/config_entries.py", line 498, in async_unload
    result = await component.async_unload_entry(hass, self)
    File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 624, in async_unload_entry
    return await component.async_unload_entry(entry)
    File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 176, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
    ValueError: Config entry was never loaded!
TheKamakaZi commented 1 year ago

Interestingly, just received this additional error alongside the one first mentioned:

/config/custom_components/localtuya/tinytuya/tinytuya/core.py:735: RuntimeWarning: coroutine 'XenonDevice._recv_all' was never awaited
  data += self._recv_all(header_len+ret_end_len-len(data))
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/config/custom_components/localtuya/common.py:384: RuntimeWarning: coroutine 'TuyaProtocol.close' was never awaited
  self._interface.close()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback