Should i have 1 driver for all lights or seperate drivers for each light?

I am developing my first homey app, I see that for example the Yeelight LAN app and many others just has one option when adding a device which is like ”yeelight” for example and then when you click that it scans for all yeelight and the govee app recently updated to also have this behaviour. I kind of like the old behaviour because than you could see for example ”aha these models sre supported, great ill buy them” but now you dont really know as easily with this new approach. The negative with the old approach of listing all the devices is of course it is more difficult for the user to look up what device model number they have and so on. Is there something in between where you can have 1 driver but list all the devices separetly on the app store?

Not in the “Supported Devices” overview of the app page, because the app store automatically builds that overview from the app’s app.json file.

You can of course add the list of supported devices to the app’s README.txt file, like the Shelly app does. Or refer to a community forum thread where you list and maintain the supported devices.

As for whether it’s better to use a single driver or multiple, for me it would depend on whether you need to use a lot of if/else statements to handle each light separately. If that’s the case, I would probably use separate drivers to prevent spaghetti-code.

But if most devices are very similar in terms of how to handle them, I would probably use a single driver.

Okey, Well im building a govee app but with LAN control instead of their rate limited API. The govee API app that is on the homey app store now recently had separete drivers for each light but switched to one driver recently. I think i will probably go with one driver

1 Like