rave
(Rave Tam)
December 19, 2016, 3:51pm
1
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’
Most integrations consist of a single platform. And in that case, it's fine to just define that one platform. However, if you are going to add a second platform, you will want to centralize your connection logic. This is done inside the component...
what i wanted to achieve is to store some global data in the hub component and access it in the sub components.
fabaff
(Fabian Affolter)
December 20, 2016, 7:16pm
2
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
rave
(Rave Tam)
December 21, 2016, 12:04am
3
Thanks and you’re right. I moved my code yesterday to the components folder and now it works perfectly.