home-assistant / architecture

Repo to discuss Home Assistant architecture
315 stars 99 forks source link

Make Unique IDs for Discoverable Config Flows Mandatory #372

Closed ctalkington closed 4 years ago

ctalkington commented 4 years ago

Context

There is a mechnism to ignore discovered config flows using unique ids attached to config flow but not all integrations may set a unique id due to lack of truly unique identifiers or just not having been updated for concerns of backwards compatibility.

This creates an UX issue that has started to become more pronounced with more config flows being added every release (which is awesome!). The real issue is not all discovery processes are created equal and that becomes an issue for consistency.

Proposal

All future integratons with discoverable config flows should be required to set a unique id during discovery.

All existing integrations should be reviewed for possible ways to improve identification during discovery config flow. A whitelist could be developed to allow existing integrations to remain functional under new requirements.

If a unique id can sometimes not be available such as older devices lack identifiers in zeroconf/ssdp/etc then the device should be prevented from being shown to user.

Another thought is to tie the requirement into the quality scale but that really wouldnt enforce anything since theres no penalties in my knowledge for not being to a certain quality currently.

Consequences

Discovery UX improves at the expense of some unidentifiable or non-conforming devices requiring manual setup.

balloob commented 4 years ago

Yeah this is great.

Here is a list of current offenders. Added either PR with a fix or tagged code owner:

frenck commented 4 years ago

Let's turn this into ADR-0011 and open up a PR @ctalkington!

ctalkington commented 4 years ago

@frenck https://github.com/home-assistant/architecture/pull/374

let me know if you see any possible refinements