Custom_components directory structure changed with 0.88?

I have a custom_component that has been running fine until I upgraded to HA 0.88. I started to see errors in the log along the lines of:

2019-02-21 10:50:39 WARNING (MainThread) [homeassistant.loader] Integrations need to be in their own folder. Change binary_sensor/webit.py to webit/binary_sensor.py. This will stop working soon.

In the documentation, the example directory structure is given as:

~/.homeassistant/custom_components/myflashyhub.py
~/.homeassistant/custom_components/light/myflashyhub.py
~/.homeassistant/custom_components/switch/myflashyhub.py

Has this changed? Should the directory structure now look like:

~/.homeassistant/custom_components/myflashyhub.py
~/.homeassistant/custom_components/myflashyhub/light.py
~/.homeassistant/custom_components/myflashyhub/switch.py

Yes , read release notes

~/.homeassistant/custom_components/__init__.py 
~/.homeassistant/custom_components/myflashyhub/light.py 
~/.homeassistant/custom_components/myflashyhub/switch.py

Would be more correct

You put me on the right track. It actually needs to look like:

~/.homeassistant/custom_components/myflashyhub/__init__.py 
~/.homeassistant/custom_components/myflashyhub/light.py 
~/.homeassistant/custom_components/myflashyhub/switch.py

where init.py used to be myflashyhub.py

1 Like

ahhh, sorry…
yes you are completely correct :slight_smile:

1 Like

I was having the same problem so I move my files and renamed them to the following:
~/.homeassistant/custom_components/lutron_caseta_pro/init.py
~/.homeassistant/custom_components/lutron_caseta_pro/cover.py
~/.homeassistant/custom_components/lutron_caseta_pro/light.py
~/.homeassistant/custom_components/lutron_caseta_pro/scene.py
~/.homeassistant/custom_components/lutron_caseta_pro/sensor.py
~/.homeassistant/custom_components/lutron_caseta_pro/switch.py

Now I am receiving this:
Setup failed for lutron_caseta_pro: Component not found.
10:35 PM setup.py (ERROR)
Unable to find component lutron_caseta_pro
10:35 PM loader.py (ERROR)
Error loading custom_components.lutron_caseta_pro. Make sure all dependencies are installed

Now none of my lutron caseta switches show up. I can put it back and they work, but then I get the error about Integrations need to be in their own folder.

What am I missing? Any help is greatly appreciated.

2 Likes

Right after I posted my last message i figured it out. There were two other files that needed to be moved into the ~/.homeassistant/custom_components/lutron_caseta_pro/ folder. button_map.md and casetify.py. Once I moved them and rebooted everything was working correctly.

1 Like

which notes?

Hello Greg. Where did you find the inti.py file? Was it called something before and you renamed it?