You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems to be some issue when setting up entities via YAML, yielding these error messages:
2020-10-18 20:28:10 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Tuya Device (YAML) for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 228, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 67, in async_setup_entry
return await hass.data[DOMAIN].async_setup_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry
raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
2020-10-18 20:28:10 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Tuya Device (YAML) for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 228, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 67, in async_setup_entry
return await hass.data[DOMAIN].async_setup_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry
raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
2020-10-18 20:28:10 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Tuya Plug 2 (YAML) for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 228, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 67, in async_setup_entry
return await hass.data[DOMAIN].async_setup_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry
raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
2020-10-18 20:28:10 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Tuya Plug 2 (YAML) for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 228, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 67, in async_setup_entry
return await hass.data[DOMAIN].async_setup_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry
raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
2020-10-18 20:28:10 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Tuya Plug 3 (YAML) for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 228, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 67, in async_setup_entry
return await hass.data[DOMAIN].async_setup_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry
raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
2020-10-18 20:28:10 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Tuya Plug 3 (YAML) for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 228, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 67, in async_setup_entry
return await hass.data[DOMAIN].async_setup_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 155, in async_setup_entry
raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!
Ok, so now I know when and why this happens. It happens whenever two or more entities with the same type ("platform") is defined for a device. The reason for this is that we iterate over each defined entity and forward the config entry being set up to its corresponding platform. If two switch entities are defined, we will forward the same config entry to the switch platform twice, which isn't correct (and the reason we get the error). It should only be done once per platform (each platform will extract entities to set up later on). I have a fix, just need to tidy up and push.
Seems to be some issue when setting up entities via YAML, yielding these error messages:
Config looks like this:
Reported in #86 (output copied from there). Will have to look into that.
The text was updated successfully, but these errors were encountered: