Config flow for integration that has only single service - check hardware before set-up

I’ve created a very simple integration ( that has only a single service.
The communication with the device is done via I2C, so if the user doesn’t enable it the integration won’t loa (and old versions of HA will crash)

My idea is to add config flow without any input, that will check if I2C is enabled and that will try to communicate with the device (the device has a fixed address). Only if everything will success the integration will be set-up.

My integration is based on
I try to follow but as I wrote before, I don’t expect any input from the user, only hardware validation and I2C check.

Id like to ask for a hint or a sample that shows how to create a config flow that doesn’t require any input from the user and that can check is specific conditions are met before the integration is set-up.

I think this is possible.

I’m not an expert on this, but my recent config flow PR does some scanning of what com ports are available before it shows the first user pane (it needs this to decide what to put in the drop-down)

I suppose it would be possible to do some checking then simply display an error or success message as the first pane.

1 Like

thank you for linking your PR.
This is exactly what I’m trying to do :slight_smile:
I’ve built a POC config flow but now I need to test it on a real device.
But belive me, the worst part is enabling I2C on PI4 running HassOS. I can’t find a good instruction on how to do that :confused: