home-assistant / architecture

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

Add default_* properties to device registry #420

Closed balloob closed 4 years ago

balloob commented 4 years ago

Context

The issue motivating this decision, and any context that influences or constrains the decision. Your motivation cannot include that the frontend is not representing the data correctly, as that is a frontend issue.

Multiple integrations can detect the same device, but one integration might know more information. This happened recently with the Mikrotik integration, a network scanner (https://github.com/home-assistant/core/issues/38809). The values it finds are not as specific as the values that the Sonos integration provides, but the way our device registry works, the last one to push data to the device registry wins.

Proposal

We should allow providing default_name, default_model and default_manufacturer. These values will be set as name, model and manufacturer only if there is no existing value set.

Consequences

We will no longer lose more precise data in favor of generic data.

Kane610 commented 4 years ago

Yes. This will allow unifi to provide more default details as well without worrying to write over first class information