Use new DeviceClass enums in bloomsky (#61316)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-09 09:14:16 +01:00 committed by GitHub
parent 23f21bd27a
commit f7f50563dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -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(
{

View file

@ -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