Add sample service and add show how to check for hardware in config flow
Misiu opened this issue · 4 comments
Is your feature request related to a problem? Please describe.
I have an integration that has a service, but now I want to add config flow to it. Your repo is commonly used, so I think it would be a good addition.
Describe the solution you'd like
I'd like to have a sample service that I could use to for example update the sensor value. Ideally, when running the config flow we should be able to check for specific device (in my case I need to check for I2C device)
It's unclear to me whether you want a service example or a config flow example.
For a config flow example, the issue is HA itself isn't set on the config flow template generator so I don't think it makes sense to put it in a custom_component template. In fact, I can't seem to find the template generator anymore on the dev docs anymore and I know at one point the template was considered incorrect.
@alandtse I've built a very simple integration that for now only offers two services (https://github.com/Misiu/argon40).
I'd like to add config flow to it.
My integration requires working I2C, so ideally config flow should check if I2C is enabled and if a specific device is available.
Currently, if someone doesn't enable I2C he will see an error in the log during startup.
I want to help as much as possible during setup and provide better info.
For example if I2C isn't enabled I want to show info and prevent installation. if a specific device isn't available I also want to show the correct message.
I hope that now my requirements are better described.
@Misiu the "feature request" template in this repo was added so that when a developer uses this repo as a template it is there, it is not designed for this repository.
If you want to create a PR to add what you are describing that is great, but I think that it may be too specific, so in the PR it needs to bee commented out, and if the dev needs it, they can uncomment it.