Use new DeviceClass enums in bloomsky (#61316)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
23f21bd27a
commit
f7f50563dd
2 changed files with 8 additions and 5 deletions
|
@ -2,8 +2,8 @@
|
|||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_MOISTURE,
|
||||
PLATFORM_SCHEMA,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.const import CONF_MONITORED_CONDITIONS
|
||||
|
@ -11,7 +11,7 @@ import homeassistant.helpers.config_validation as cv
|
|||
|
||||
from . import DOMAIN
|
||||
|
||||
SENSOR_TYPES = {"Rain": DEVICE_CLASS_MOISTURE, "Night": None}
|
||||
SENSOR_TYPES = {"Rain": BinarySensorDeviceClass.MOISTURE, "Night": None}
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
"""Support the sensor of a BloomSky weather station."""
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
||||
from homeassistant.components.sensor import (
|
||||
PLATFORM_SCHEMA,
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
AREA_SQUARE_METERS,
|
||||
CONF_MONITORED_CONDITIONS,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
ELECTRIC_POTENTIAL_MILLIVOLT,
|
||||
PERCENTAGE,
|
||||
PRESSURE_INHG,
|
||||
|
@ -47,7 +50,7 @@ SENSOR_UNITS_METRIC = {
|
|||
|
||||
# Device class
|
||||
SENSOR_DEVICE_CLASS = {
|
||||
"Temperature": DEVICE_CLASS_TEMPERATURE,
|
||||
"Temperature": SensorDeviceClass.TEMPERATURE,
|
||||
}
|
||||
|
||||
# Which sensors to format numerically
|
||||
|
|
Loading…
Add table
Reference in a new issue