mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
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,8 +2,8 @@
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_MOISTURE,
|
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
|
BinarySensorDeviceClass,
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_MONITORED_CONDITIONS
|
from homeassistant.const import CONF_MONITORED_CONDITIONS
|
||||||
@ -11,7 +11,7 @@ import homeassistant.helpers.config_validation as cv
|
|||||||
|
|
||||||
from . import DOMAIN
|
from . import DOMAIN
|
||||||
|
|
||||||
SENSOR_TYPES = {"Rain": DEVICE_CLASS_MOISTURE, "Night": None}
|
SENSOR_TYPES = {"Rain": BinarySensorDeviceClass.MOISTURE, "Night": None}
|
||||||
|
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
"""Support the sensor of a BloomSky weather station."""
|
"""Support the sensor of a BloomSky weather station."""
|
||||||
import voluptuous as vol
|
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 (
|
from homeassistant.const import (
|
||||||
AREA_SQUARE_METERS,
|
AREA_SQUARE_METERS,
|
||||||
CONF_MONITORED_CONDITIONS,
|
CONF_MONITORED_CONDITIONS,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
|
||||||
ELECTRIC_POTENTIAL_MILLIVOLT,
|
ELECTRIC_POTENTIAL_MILLIVOLT,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
PRESSURE_INHG,
|
PRESSURE_INHG,
|
||||||
@ -47,7 +50,7 @@ SENSOR_UNITS_METRIC = {
|
|||||||
|
|
||||||
# Device class
|
# Device class
|
||||||
SENSOR_DEVICE_CLASS = {
|
SENSOR_DEVICE_CLASS = {
|
||||||
"Temperature": DEVICE_CLASS_TEMPERATURE,
|
"Temperature": SensorDeviceClass.TEMPERATURE,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Which sensors to format numerically
|
# Which sensors to format numerically
|
||||||
|
Loading…
x
Reference in New Issue
Block a user