Open NoRi2909 opened 4 weeks ago
Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (sensor
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
sensor documentation sensor source (message by IssueLinks)
The problem
There are two sensor types for VOC:
https://github.com/home-assistant/core/blob/b1470fd9b8b7fe78589f58eb6f4ed4de62591bb1/homeassistant/components/sensor/strings.json#L263-L267
As the second, actually called "volatile_organic_compounds_parts" in the documentation, simply references the name of the first this results in duplicate menu items in several places. Here when creating a sensor Helper:
To fix this we simply need a separate short name for the second and replace all references to the first.
The first needs no addendum as it is measured in µg/m³ like all other concentrations (PM1, PM2.5, PM10, NO, NO₂, NOₓ, SO₂, ozone). The second is in ppm/ppb which are only used for CO and CO₂ as well.
I suggest we pick
VOC parts
for the second which matches the documentation, too.So the first step is to replace the three occurrences in the Sensor component:
Name:
https://github.com/home-assistant/core/blob/b1470fd9b8b7fe78589f58eb6f4ed4de62591bb1/homeassistant/components/sensor/strings.json#L267
Condition:
https://github.com/home-assistant/core/blob/b1470fd9b8b7fe78589f58eb6f4ed4de62591bb1/homeassistant/components/sensor/strings.json#L46
Trigger:
https://github.com/home-assistant/core/blob/b1470fd9b8b7fe78589f58eb6f4ed4de62591bb1/homeassistant/components/sensor/strings.json#L96
Once this is done we can fix the name references from four other components to use the "VOC_parts" name instead of copying the "VOC" name:
https://github.com/home-assistant/core/blob/9bf0cbd65937f9cf7abdd08a8e7c81972c52a0c8/homeassistant/components/random/strings.json#L128
https://github.com/home-assistant/core/blob/9bf0cbd65937f9cf7abdd08a8e7c81972c52a0c8/homeassistant/components/scrape/strings.json#L185
https://github.com/home-assistant/core/blob/9bf0cbd65937f9cf7abdd08a8e7c81972c52a0c8/homeassistant/components/sql/strings.json#L117
https://github.com/home-assistant/core/blob/9bf0cbd65937f9cf7abdd08a8e7c81972c52a0c8/homeassistant/components/template/strings.json#L334
All four above need to be changed to:
If that's done there will be no more duplicate "VOC" items in the UI.
What version of Home Assistant Core has the issue?
2024.10.4
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Sensor
Link to integration documentation on our website
https://www.home-assistant.io/integrations/sensor/