New integration from the scratch

Need a hint on architecture. My RPi with Hassio connected by USB to an Arduino with my own firmware, which, in turn, connects up to 8 temperature and humidity sensors, as well as a fan.

  1. I wrote an addon, which is able to update the Arduino’s firmware OTA, without re-switching.
  2. I wrote a custom component on python, which periodically requests information from the Arduino and issues it through 16 Sensor Entities on main HA page.
  3. I also need switches for controlling the hardware, that is, Switch Entities.

The question is that now the addon itself is a component with sensors in itself, and I can make a separate component with switches. But since the piece of hardware is one, only one software entity should be responsible for interacting with it, and everything else (commands for updating the firmware, switches, sensor values) should only refer to it.

How is all this made out? Interaction with a piece of iron it should be service in architecture HA?

If someone has a similar question, then to save time, need to look:

  1. Files in components/arduino/.
  2. Info for changes in configuration.yaml https://www.home-assistant.io/components/arduino/
  3. Instead from homeassistant.components import arduino have import custom_components.your_component as your_component