Closed cgarwood closed 6 years ago
I was able to fix the import problem by squeezing all the code into one file, but after that all my platforms are broken:
2018-05-05 16:08:06 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform lutron_caseta_pro
Traceback (most recent call last):
File "/home/neal/dev/src/home-assistant/homeassistant/helpers/entity_platform.py", line 125, in _async_setup_platform
task = async_create_setup_task()
File "/home/neal/dev/src/home-assistant/homeassistant/helpers/entity_platform.py", line 90, in async_create_setup_task
None, platform.setup_platform, hass, platform_config,
AttributeError: module 'light.lutron_caseta_pro' has no attribute 'setup_platform'
I tried changing my async_setup_platform
to setup_platform
and removing the asyncio but it still doesn't work.
I don't know what they have been doing in the Home Assistant code, but it broke everything. :(
Looks like there's another PR with fixes related to the custom_components fix, not sure if it will help in this case or not: https://github.com/home-assistant/home-assistant/pull/14317
Custom components should not import from one another. If you want to import other custom components, do this:
# If it's a component
hass.components.casetify.some_method()
# If it's a platfrom
from homeassistant.loader import get_component
platform = get_component(hass, 'light.hue')
Anybody try the released version of 0.69? Does it break this component?
The custom_component changes to HomeAssistant were reverted, so this component is working again on the released 0.69 version.
Then close this issue ;)
HomeAssistant 0.69 beta includes a PR that changes the way custom_components load: https://github.com/home-assistant/home-assistant/pull/14211
It looks like this breaks the custom component, as I get the following error with 0.69: