Add and use more unit constants (#32122)

* Add and use speed constants

* Add and use meter based volume and area constants

* Add and use more mass unit constants

* Add and use concentration unit constants

* Add and use watts per square meter constant

* Use more time constants

* Use more data constants
This commit is contained in:
Ville Skyttä 2020-02-25 03:52:14 +02:00 committed by GitHub
parent c98f50115d
commit 496bd3dddf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 422 additions and 177 deletions

View file

@ -3,6 +3,7 @@ import logging
from homeassistant.components.sensor import ENTITY_ID_FORMAT
from homeassistant.const import (
CONCENTRATION_PARTS_PER_MILLION,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_TEMPERATURE,
@ -20,8 +21,13 @@ SENSOR_TYPES = {
None,
DEVICE_CLASS_TEMPERATURE,
],
"com.fibaro.smokeSensor": ["Smoke", "ppm", "mdi:fire", None],
"CO2": ["CO2", "ppm", "mdi:cloud", None],
"com.fibaro.smokeSensor": [
"Smoke",
CONCENTRATION_PARTS_PER_MILLION,
"mdi:fire",
None,
],
"CO2": ["CO2", CONCENTRATION_PARTS_PER_MILLION, "mdi:cloud", None],
"com.fibaro.humiditySensor": ["Humidity", "%", None, DEVICE_CLASS_HUMIDITY],
"com.fibaro.lightSensor": ["Light", "lx", None, DEVICE_CLASS_ILLUMINANCE],
}