Component or add_on

I have several simple features that could be implemented either as custom components or add-on. Components are more lightweight and hence presumably preferable, except for one thing: often a library is required (typically from PyPi), and I have not found any way to install it in a hassos install.

Am I correct that for this reason I should create add-ons, rather than components, whenever a library is required?

Example: gps reader requires pynmea2 (there is already a gps component available, but that one requires gaps, which again cannot be installed in hassos).

You specify in the manifest file for the integration any requirement this integration has and will install it for you when the integration is loaded.

Also addons run applications.

Integrations interface applications or devices with home assistant.

Thank you! How I could overlook the requirements.

Now I ran into a new issue: I’ve copied the `hello_world’ example (example-custom-config/custom_components/hello_world at master · home-assistant/example-custom-config · GitHub) to my custom_components directory. After restarting (is there a way to avoid that step?) I get the following error:

Setup failed for custom integration hello_world: No setup or config entry setup function defined.

Apparently this was an issue in an older version of HA. But I am running the newest version! Perhaps the error cropped up again. I have no clue where to look to diagnose; the log has no further information.

Never figured out what the problem was. In fact, with the example component, my home assistant would no longer start (reports as health, ssh works, but UI is inaccessible).

Using addons instead.