mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use new device class in metoffice (#83366)
This commit is contained in:
parent
a14e465246
commit
11609a63e3
@ -12,11 +12,11 @@ from homeassistant.components.sensor import (
|
|||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
LENGTH_KILOMETERS,
|
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
SPEED_MILES_PER_HOUR,
|
|
||||||
TEMP_CELSIUS,
|
|
||||||
UV_INDEX,
|
UV_INDEX,
|
||||||
|
UnitOfLength,
|
||||||
|
UnitOfSpeed,
|
||||||
|
UnitOfTemperature,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -65,7 +65,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||||||
key="temperature",
|
key="temperature",
|
||||||
name="Temperature",
|
name="Temperature",
|
||||||
device_class=SensorDeviceClass.TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||||
icon=None,
|
icon=None,
|
||||||
entity_registry_enabled_default=True,
|
entity_registry_enabled_default=True,
|
||||||
),
|
),
|
||||||
@ -73,17 +73,16 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||||||
key="feels_like_temperature",
|
key="feels_like_temperature",
|
||||||
name="Feels like temperature",
|
name="Feels like temperature",
|
||||||
device_class=SensorDeviceClass.TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||||
icon=None,
|
icon=None,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="wind_speed",
|
key="wind_speed",
|
||||||
name="Wind speed",
|
name="Wind speed",
|
||||||
native_unit_of_measurement=SPEED_MILES_PER_HOUR,
|
native_unit_of_measurement=UnitOfSpeed.MILES_PER_HOUR,
|
||||||
suggested_unit_of_measurement=SPEED_MILES_PER_HOUR,
|
suggested_unit_of_measurement=UnitOfSpeed.MILES_PER_HOUR,
|
||||||
device_class=SensorDeviceClass.SPEED,
|
device_class=SensorDeviceClass.WIND_SPEED,
|
||||||
icon="mdi:weather-windy",
|
|
||||||
entity_registry_enabled_default=True,
|
entity_registry_enabled_default=True,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
@ -95,10 +94,9 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="wind_gust",
|
key="wind_gust",
|
||||||
name="Wind gust",
|
name="Wind gust",
|
||||||
native_unit_of_measurement=SPEED_MILES_PER_HOUR,
|
native_unit_of_measurement=UnitOfSpeed.MILES_PER_HOUR,
|
||||||
suggested_unit_of_measurement=SPEED_MILES_PER_HOUR,
|
suggested_unit_of_measurement=UnitOfSpeed.MILES_PER_HOUR,
|
||||||
device_class=SensorDeviceClass.SPEED,
|
device_class=SensorDeviceClass.WIND_SPEED,
|
||||||
icon="mdi:weather-windy",
|
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
@ -111,7 +109,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="visibility_distance",
|
key="visibility_distance",
|
||||||
name="Visibility distance",
|
name="Visibility distance",
|
||||||
native_unit_of_measurement=LENGTH_KILOMETERS,
|
native_unit_of_measurement=UnitOfLength.KILOMETERS,
|
||||||
device_class=SensorDeviceClass.DISTANCE,
|
device_class=SensorDeviceClass.DISTANCE,
|
||||||
icon="mdi:eye",
|
icon="mdi:eye",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user