Use new SensorDeviceClass in metoffice (#61899)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
b91124c030
commit
ce2063fb07
1 changed files with 8 additions and 6 deletions
|
@ -1,11 +1,13 @@
|
|||
"""Support for UK Met Office weather service."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
|
||||
from homeassistant.components.sensor import (
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
SensorEntityDescription,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
ATTR_ATTRIBUTION,
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
LENGTH_KILOMETERS,
|
||||
PERCENTAGE,
|
||||
SPEED_MILES_PER_HOUR,
|
||||
|
@ -58,7 +60,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||
SensorEntityDescription(
|
||||
key="temperature",
|
||||
name="Temperature",
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
icon=None,
|
||||
entity_registry_enabled_default=True,
|
||||
|
@ -66,7 +68,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||
SensorEntityDescription(
|
||||
key="feels_like_temperature",
|
||||
name="Feels Like Temperature",
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
icon=None,
|
||||
entity_registry_enabled_default=False,
|
||||
|
@ -130,7 +132,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||
SensorEntityDescription(
|
||||
key="humidity",
|
||||
name="Humidity",
|
||||
device_class=DEVICE_CLASS_HUMIDITY,
|
||||
device_class=SensorDeviceClass.HUMIDITY,
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon=None,
|
||||
entity_registry_enabled_default=False,
|
||||
|
|
Loading…
Add table
Reference in a new issue