JH-Soft-Technology / pyinels

Python library for communication and control iNels BUS CU3 smart home unit from Elko EP.
GNU General Public License v3.0
2 stars 4 forks source link

Problem with asynch #25

Closed stevoh6 closed 2 years ago

stevoh6 commented 3 years ago

HI, I was almost able use newest pyinels in InnelsForHass with those changes (https://github.com/stevoh6/InelsForHass/commits/master6) but there is a problem with asynch implementation of calls in PyInels. Im not skilled in asynch calls, so I was unable to solve it. There are mine attempts (https://github.com/stevoh6/pyinels/commits/master )

Basically problem is, that HA or InnelsForHass is trying to read new devices, but they are not ready, since they are loading asynch. Logs:

\cf1 2021-08-11 00:20:57 INFO (MainThread) [custom_components.inels.config_flow] Config flow for Inels\par
2021-08-11 00:20:57 INFO (MainThread) [custom_components.inels]\~\par
-------------------------------------------------------------------\par
Inels\par
Version: 0.2.0\par
This is a custom integration!\par
If you have any issues with this you need to open an issue here:\par
{{\field{\*\fldinst{HYPERLINK https://github.com/JH-Soft-Technology/InelsForHass/Issues }}{\fldrslt{https://github.com/JH-Soft-Technology/InelsForHass/Issues\ul0\cf0}}}}\f0\fs21\par
-------------------------------------------------------------------\par
2021-08-11 00:20:57 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:20:57 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:20:57 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
\cf0 2021-08-11 00:21:05 WARNING (MainThread) [homeassistant.setup] Setup of zone is taking over 10 seconds.\par
2021-08-11 00:21:05 WARNING (MainThread) [homeassistant.setup] Setup of timer is taking over 10 seconds.\par
2021-08-11 00:21:05 WARNING (MainThread) [homeassistant.setup] Setup of skodaconnect is taking over 10 seconds.\par
\cf1 2021-08-11 00:21:06 INFO (MainThread) [custom_components.inels.cover] Setting up shutters\par
2021-08-11 00:21:06 INFO (MainThread) [custom_components.inels.switch] Setting up switches\par
\cf0 2021-08-11 00:21:06 WARNING (MainThread) [homeassistant.components.xiaomi_miio.vacuum] Loading Xiaomi Miio Vacuum via platform setup is deprecated; Please remove it from your configuration\par
2021-08-11 00:21:06 ERROR (MainThread) [homeassistant.components.cover] Error while setting up inels platform for cover\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/cover.py", line 40, in async_setup_entry\par
shutters = [pyShutter(dev) for dev in entities if dev.type == DEVICE_CLASS_SHUTTER]\par
TypeError: 'coroutine' object is not iterable\par
\cf0 2021-08-11 00:21:06 ERROR (MainThread) [homeassistant.components.switch] Error while setting up inels platform for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/switch.py", line 30, in async_setup_entry\par
devices = [dev for dev in entities if dev.type == SWITCH or dev.type == DOOR]\par
TypeError: 'coroutine' object is not iterable\par
2021-08-11 00:21:06 INFO (MainThread) [custom_components.inels.light] Setting up lights\par
\cf0 2021-08-11 00:21:06 ERROR (MainThread) [homeassistant.components.light] Error while setting up inels platform for light\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/light.py", line 35, in async_setup_entry\par
lights = [pyLight(dev) for dev in devices if dev.type == LIGHT]\par
TypeError: 'coroutine' object is not iterable\par
2021-08-11 00:43:57 INFO (MainThread) [custom_components.inels.config_flow] Initialize InelsOptionsFlowHandler\par
2021-08-11 00:44:01 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:01 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:01 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
2021-08-11 00:44:01 INFO (MainThread) [custom_components.inels.switch] Setting up switches\par
2021-08-11 00:44:01 INFO (MainThread) [custom_components.inels.light] Setting up lights\par
\cf0 2021-08-11 00:44:01 ERROR (MainThread) [homeassistant.components.switch] Error while setting up inels platform for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/switch.py", line 30, in async_setup_entry\par
devices = [dev for dev in entities if dev.type == SWITCH or dev.type == DOOR]\par
TypeError: 'coroutine' object is not iterable\par
\cf0 2021-08-11 00:44:01 ERROR (MainThread) [homeassistant.components.light] Error while setting up inels platform for light\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/light.py", line 35, in async_setup_entry\par
lights = [pyLight(dev) for dev in devices if dev.type == LIGHT]\par
TypeError: 'coroutine' object is not iterable\par
2021-08-11 00:44:06 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:06 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:06 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
2021-08-11 00:44:06 INFO (MainThread) [custom_components.inels.switch] Setting up switches\par
2021-08-11 00:44:06 INFO (MainThread) [custom_components.inels.light] Setting up lights\par
\cf0 2021-08-11 00:44:06 ERROR (MainThread) [homeassistant.components.switch] Error while setting up inels platform for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/switch.py", line 30, in async_setup_entry\par
devices = [dev for dev in entities if dev.type == SWITCH or dev.type == DOOR]\par
TypeError: 'coroutine' object is not iterable\par
\cf0 2021-08-11 00:44:06 ERROR (MainThread) [homeassistant.components.light] Error while setting up inels platform for light\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/light.py", line 35, in async_setup_entry\par
lights = [pyLight(dev) for dev in devices if dev.type == LIGHT]\par
TypeError: 'coroutine' object is not iterable\par
2021-08-11 00:44:09 INFO (MainThread) [custom_components.inels.config_flow] Initialize InelsOptionsFlowHandler\par
\cf0 2021-08-11 00:44:11 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 432, in async_unload\par
result = await component.async_unload_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 79, in async_unload_entry\par
return await hass.data[DOMAIN].async_unload_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry\par
raise ValueError("Config entry was never loaded!")\par
ValueError: Config entry was never loaded!\par
\cf0 2021-08-11 00:44:11 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Inels for light\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 432, in async_unload\par
result = await component.async_unload_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 467, in async_unload_entry\par
return await component.async_unload_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry\par
raise ValueError("Config entry was never loaded!")\par
ValueError: Config entry was never loaded!\par
\cf0 2021-08-11 00:44:11 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 432, in async_unload\par
result = await component.async_unload_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 79, in async_unload_entry\par
return await hass.data[DOMAIN].async_unload_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry\par
raise ValueError("Config entry was never loaded!")\par
ValueError: Config entry was never loaded!\par
\cf0 2021-08-11 00:44:11 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Inels for light\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 432, in async_unload\par
result = await component.async_unload_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 467, in async_unload_entry\par
return await component.async_unload_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry\par
raise ValueError("Config entry was never loaded!")\par
ValueError: Config entry was never loaded!\par
2021-08-11 00:44:11 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:11 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:11 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
2021-08-11 00:44:11 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:11 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:11 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
2021-08-11 00:44:11 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:11 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:11 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
\cf0 2021-08-11 00:44:11 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 74, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:11 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 74, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
2021-08-11 00:44:11 INFO (MainThread) [custom_components.inels.switch] Setting up switches\par
\cf0 2021-08-11 00:44:11 ERROR (MainThread) [homeassistant.components.switch] Error while setting up inels platform for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/switch.py", line 30, in async_setup_entry\par
devices = [dev for dev in entities if dev.type == SWITCH or dev.type == DOOR]\par
TypeError: 'coroutine' object is not iterable\par
2021-08-11 00:44:16 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:16 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:16 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
2021-08-11 00:44:16 INFO (MainThread) [custom_components.inels.switch] Setting up switches\par
\cf0 2021-08-11 00:44:16 ERROR (MainThread) [homeassistant.components.switch] Error while setting up inels platform for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/switch.py", line 30, in async_setup_entry\par
devices = [dev for dev in entities if dev.type == SWITCH or dev.type == DOOR]\par
TypeError: 'coroutine' object is not iterable\par
2021-08-11 00:44:18 INFO (MainThread) [custom_components.inels.config_flow] Initialize InelsOptionsFlowHandler\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 432, in async_unload\par
result = await component.async_unload_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 79, in async_unload_entry\par
return await hass.data[DOMAIN].async_unload_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry\par
raise ValueError("Config entry was never loaded!")\par
ValueError: Config entry was never loaded!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 432, in async_unload\par
result = await component.async_unload_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 79, in async_unload_entry\par
return await hass.data[DOMAIN].async_unload_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry\par
raise ValueError("Config entry was never loaded!")\par
ValueError: Config entry was never loaded!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 432, in async_unload\par
result = await component.async_unload_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 79, in async_unload_entry\par
return await hass.data[DOMAIN].async_unload_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry\par
raise ValueError("Config entry was never loaded!")\par
ValueError: Config entry was never loaded!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 432, in async_unload\par
result = await component.async_unload_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 79, in async_unload_entry\par
return await hass.data[DOMAIN].async_unload_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry\par
raise ValueError("Config entry was never loaded!")\par
ValueError: Config entry was never loaded!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 432, in async_unload\par
result = await component.async_unload_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 79, in async_unload_entry\par
return await hass.data[DOMAIN].async_unload_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry\par
raise ValueError("Config entry was never loaded!")\par
ValueError: Config entry was never loaded!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 432, in async_unload\par
result = await component.async_unload_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 79, in async_unload_entry\par
return await hass.data[DOMAIN].async_unload_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry\par
raise ValueError("Config entry was never loaded!")\par
ValueError: Config entry was never loaded!\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 74, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for light\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 461, in async_setup_entry\par
return await component.async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for cover\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 159, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 74, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for light\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 461, in async_setup_entry\par
return await component.async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for cover\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 159, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 74, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for light\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 461, in async_setup_entry\par
return await component.async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for cover\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 159, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 74, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for light\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 461, in async_setup_entry\par
return await component.async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for cover\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 159, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 74, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for light\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 461, in async_setup_entry\par
return await component.async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for cover\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 159, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 74, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for light\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 461, in async_setup_entry\par
return await component.async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Inels for cover\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup\par
result = await component.async_setup_entry(hass, self) # type: ignore\par
File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 159, in async_setup_entry\par
return await hass.data[DOMAIN].async_setup_entry(entry)\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 164, in async_setup_entry\par
raise ValueError("Config entry has already been setup!")\par
ValueError: Config entry has already been setup!\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels.switch] Setting up switches\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels.light] Setting up lights\par
2021-08-11 00:44:21 INFO (MainThread) [custom_components.inels.cover] Setting up shutters\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.components.switch] Error while setting up inels platform for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/switch.py", line 30, in async_setup_entry\par
devices = [dev for dev in entities if dev.type == SWITCH or dev.type == DOOR]\par
TypeError: 'coroutine' object is not iterable\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.components.light] Error while setting up inels platform for light\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/light.py", line 35, in async_setup_entry\par
lights = [pyLight(dev) for dev in devices if dev.type == LIGHT]\par
TypeError: 'coroutine' object is not iterable\par
\cf0 2021-08-11 00:44:21 ERROR (MainThread) [homeassistant.components.cover] Error while setting up inels platform for cover\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/cover.py", line 40, in async_setup_entry\par
shutters = [pyShutter(dev) for dev in entities if dev.type == DEVICE_CLASS_SHUTTER]\par
TypeError: 'coroutine' object is not iterable\par
2021-08-11 00:44:33 INFO (MainThread) [custom_components.inels] Creating coordinator\par
2021-08-11 00:44:33 INFO (MainThread) [custom_components.inels] Loading platforms with entries\~\par
2021-08-11 00:44:33 INFO (MainThread) [custom_components.inels] <homeassistant.config_entries.ConfigEntry object at 0x7fa36eae00>\par
2021-08-11 00:44:33 INFO (MainThread) [custom_components.inels.switch] Setting up switches\par
2021-08-11 00:44:33 INFO (MainThread) [custom_components.inels.light] Setting up lights\par
2021-08-11 00:44:33 INFO (MainThread) [custom_components.inels.cover] Setting up shutters\par
\cf0 2021-08-11 00:44:33 ERROR (MainThread) [homeassistant.components.switch] Error while setting up inels platform for switch\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/switch.py", line 30, in async_setup_entry\par
devices = [dev for dev in entities if dev.type == SWITCH or dev.type == DOOR]\par
TypeError: 'coroutine' object is not iterable\par
\cf0 2021-08-11 00:44:33 ERROR (MainThread) [homeassistant.components.light] Error while setting up inels platform for light\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/light.py", line 35, in async_setup_entry\par
lights = [pyLight(dev) for dev in devices if dev.type == LIGHT]\par
TypeError: 'coroutine' object is not iterable\par
\cf0 2021-08-11 00:44:33 ERROR (MainThread) [homeassistant.components.cover] Error while setting up inels platform for cover\par
\cf1 Traceback (most recent call last):\par
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform\par
await asyncio.shield(task)\par
File "/config/custom_components/inels/cover.py", line 40, in async_setup_entry\par
shutters = [pyShutter(dev) for dev in entities if dev.type == DEVICE_CLASS_SHUTTER]\par
TypeError: 'coroutine' object is not iterable\par
\cf0\f1\fs24\par
}

Problematic part is probably usage 'run_in_executor' method. https://stackoverflow.com/questions/68580616/python-3-8-future-is-returned-instead-of-value-when-awaited

Could you please look at it? Thansks.

jhoralek commented 2 years ago

Hi there, I'm currently working on this issue. New release will be issued soon.

stevoh6 commented 2 years ago

Awesome news :) πŸ’― πŸš€ πŸš€ πŸš€ can I help you somehow? Atleast testing? Can I get access to azure repo? You suggesting creating issues there, but I hasn't acces there. My mail: gemi69@hotmail.sk Thanks :)

jhoralek commented 2 years ago

Hi stevoh6. Async reverted to good old sync call.. This library is mainly developed for InelsForHass which is integration into the Home assistant. If you prefer to use home assistant than inels app like me, then try it out. You will find it here https://github.com/JH-Soft-Technology/InelsForHass and the way how to use it here https://hacs.xyz/

Both the library and the integration is still in progress ;-)