Breaking changes in 0.91

Hi, This is my first post to the community, so hope its in the right place…

In the release notes for the latest version there is a breaking change for the way custom components work.

“We finished the great migration. All built-in platforms are now in their own folder. This means that if you had a custom component or platform that had the same name as a built-in one, you have to rename it. If you still have platforms in your custom_components/ directory in the old file format, sensor/my_platform.py , rename it to my_platform/sensor.py . It still works but it will not be supported in a future release.”

I’m using one such integration for Sonoff switches using original firmware ( https://github.com/peterbuga/HASS-sonoff-ewelink ), so after the upgrade I altered the directory structure and naming conventions as per the release notes and it all broke… (sensors and switches unavailable, with a mis configuration message in the main logs)

The old working structure and names is:

 custom_components
    ├── sonoff.py
    └── switch
        └── sonoff.py
    └── sensor
        └── sonoff.py

And I changed this to:

custom_components
    ├── sonoff.py
    └── sonoff
        └── switch.py
        └── sensor.py

`
Any ideas why this does not work ? (or have I misinterpreted the instructions ?)

Phil.

I would say :

custom_components
   └── sonoff
       └── __init__.py
       └── switch.py
       └── sensor.py

Where __init__.py is your sonoff.py renamed.

Cool, made the changes you suggest and the Sonoff devices are up and running with the new structure :slight_smile:

However, all 51 of my Hue lights are now unavailable :frowning:

Rebooted a couple of times with the same result…

UPDATE: Scratch that…, after 5 mins or so they all came back online… weird…

I am running this on an old Raspberry Pi A, so it might be a touch overloaded…, I have a Pi 3 B+ arriving in the post today and will be moving over to that, but the Pi A is surprisingly performant most of the time, just can be a bit slow loading the logbook and history tabs.

Glad it’s working back.
Basically for all custom components you have, this structure would be correct from now.

This is 100% dealt with in peterbuga’s repo.