Skip to content

Commit 472d70b

Browse files
authored
Add comment on conversion factor for Carbon monoxide on dependency molecular weight (home-assistant#152535)
1 parent 017a84a commit 472d70b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

homeassistant/util/unit_conversion.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ class CarbonMonoxideConcentrationConverter(BaseUnitConverter):
174174
UNIT_CLASS = "carbon_monoxide"
175175
_UNIT_CONVERSION: dict[str | None, float] = {
176176
CONCENTRATION_PARTS_PER_MILLION: 1,
177-
CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER: 1.145609,
177+
# concentration (mg/m3) = 0.0409 x concentration (ppm) x molecular weight
178+
# Carbon monoxide molecular weight: 28.01 g/mol
179+
CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER: 0.0409 * 28.01,
178180
}
179181
VALID_UNITS = {
180182
CONCENTRATION_PARTS_PER_MILLION,

0 commit comments

Comments
 (0)