Commit 2f9a38a
committed
Use metric.display_id for the default entity_id (de-duplicated prefix)
The entity_id suggestion now comes from metric.display_id (added in the
library), which strips the duplicated device-type prefix, e.g.
solarcharger_3_solarcharger_total_pv_yield -> solarcharger_3_total_pv_yield.
unique_id is intentionally left derived from metric.unique_id, so entity
identity is unchanged; Home Assistant applies a suggested entity_id only on
first creation, so existing entities keep their entity_id and only newly
created entities get the cleaner id. getattr fallback stays safe for bundled
libraries predating display_id.1 parent f86b400 commit 2f9a38a
1 file changed
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
74 | 83 | | |
75 | 84 | | |
76 | 85 | | |
| |||
0 commit comments