Add pressure sensor device class (#16965)
* Add pressure sensor device class * Undo github desktop line exclude
This commit is contained in:
1 parent
45fdda3f5d
commit
70ce9bb7bc
3 files changed
+5
-3
No files matched your search
@@ -14,7 +14,7 @@ from homeassistant.helpers.entity_component import EntityComponent
|
||||
from homeassistant.helpers.config_validation import PLATFORM_SCHEMA # noqa
|
||||
from homeassistant.const import (
|
||||
DEVICE_CLASS_BATTERY, DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_ILLUMINANCE,
|
||||
DEVICE_CLASS_TEMPERATURE)
|
||||
DEVICE_CLASS_TEMPERATURE, DEVICE_CLASS_PRESSURE)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -28,6 +28,7 @@ DEVICE_CLASSES = [
|
||||
DEVICE_CLASS_HUMIDITY, # % of humidity in the air
|
||||
DEVICE_CLASS_ILLUMINANCE, # current light level (lx/lm)
|
||||
DEVICE_CLASS_TEMPERATURE, # temperature (C/F)
|
||||
DEVICE_CLASS_PRESSURE, # pressure (hPa/mbar)
|
||||
]
|
||||
|
||||
DEVICE_CLASSES_SCHEMA = vol.All(vol.Lower, vol.In(DEVICE_CLASSES))
|
||||
|
||||
@@ -5,7 +5,7 @@ from homeassistant.components.xiaomi_aqara import (PY_XIAOMI_GATEWAY,
|
||||
XiaomiDevice)
|
||||
from homeassistant.const import (
|
||||
DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_ILLUMINANCE, DEVICE_CLASS_TEMPERATURE,
|
||||
TEMP_CELSIUS)
|
||||
TEMP_CELSIUS, DEVICE_CLASS_PRESSURE)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -14,7 +14,7 @@ SENSOR_TYPES = {
|
||||
'humidity': ['%', None, DEVICE_CLASS_HUMIDITY],
|
||||
'illumination': ['lm', None, DEVICE_CLASS_ILLUMINANCE],
|
||||
'lux': ['lx', None, DEVICE_CLASS_ILLUMINANCE],
|
||||
'pressure': ['hPa', 'mdi:gauge', None]
|
||||
'pressure': ['hPa', None, DEVICE_CLASS_PRESSURE]
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user