Access Component in Sub Component

I tried the example below but it always throw the error below when i loads the sub component’s code.

Import Error : No module named ‘homeassistant.components.myflashyhub’

what i wanted to achieve is to store some global data in the hub component and access it in the sub components.

Could be that this only works for built-in components/platforms or such which are located in the homeassistant folder. import is sensitive for locations.

1 Like

Thanks and you’re right. I moved my code yesterday to the components folder and now it works perfectly.