Introduce unit enums for irradiance (#83414)

This commit is contained in:
epenet 2022-12-08 18:41:38 +01:00 committed by GitHub
parent 0eacd84ff3
commit 90438edc17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 8 deletions

View file

@ -26,8 +26,8 @@ from homeassistant.components.recorder.models import (
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
REVOLUTIONS_PER_MINUTE,
VOLUME_CUBIC_FEET,
VOLUME_CUBIC_METERS,
UnitOfIrradiance,
UnitOfVolume,
)
from homeassistant.core import HomeAssistant, State, callback, split_entity_id
from homeassistant.exceptions import HomeAssistantError
@ -54,9 +54,10 @@ DEFAULT_STATISTICS = {
}
EQUIVALENT_UNITS = {
"BTU/(h×ft²)": UnitOfIrradiance.BTUS_PER_HOUR_SQUARE_FOOT,
"RPM": REVOLUTIONS_PER_MINUTE,
"ft3": VOLUME_CUBIC_FEET,
"m3": VOLUME_CUBIC_METERS,
"ft3": UnitOfVolume.CUBIC_FEET,
"m3": UnitOfVolume.CUBIC_METERS,
}
# Keep track of entities for which a warning about decreasing value has been logged