mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Migrate OpenUV to new entity naming style (#74919)
This commit is contained in:
parent
a19ab389fc
commit
b4e5c95e03
@ -183,6 +183,8 @@ class OpenUV:
|
||||
class OpenUvEntity(Entity):
|
||||
"""Define a generic OpenUV entity."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(self, openuv: OpenUV, description: EntityDescription) -> None:
|
||||
"""Initialize."""
|
||||
self._attr_extra_state_attributes = {}
|
||||
|
@ -18,7 +18,7 @@ ATTR_PROTECTION_WINDOW_STARTING_UV = "start_uv"
|
||||
|
||||
BINARY_SENSOR_DESCRIPTION_PROTECTION_WINDOW = BinarySensorEntityDescription(
|
||||
key=TYPE_PROTECTION_WINDOW,
|
||||
name="Protection Window",
|
||||
name="Protection window",
|
||||
icon="mdi:sunglasses",
|
||||
)
|
||||
|
||||
|
@ -49,68 +49,68 @@ UV_LEVEL_LOW = "Low"
|
||||
SENSOR_DESCRIPTIONS = (
|
||||
SensorEntityDescription(
|
||||
key=TYPE_CURRENT_OZONE_LEVEL,
|
||||
name="Current Ozone Level",
|
||||
name="Current ozone level",
|
||||
device_class=SensorDeviceClass.OZONE,
|
||||
native_unit_of_measurement="du",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key=TYPE_CURRENT_UV_INDEX,
|
||||
name="Current UV Index",
|
||||
name="Current UV index",
|
||||
icon="mdi:weather-sunny",
|
||||
native_unit_of_measurement=UV_INDEX,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key=TYPE_CURRENT_UV_LEVEL,
|
||||
name="Current UV Level",
|
||||
name="Current UV level",
|
||||
icon="mdi:weather-sunny",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key=TYPE_MAX_UV_INDEX,
|
||||
name="Max UV Index",
|
||||
name="Max UV index",
|
||||
icon="mdi:weather-sunny",
|
||||
native_unit_of_measurement=UV_INDEX,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key=TYPE_SAFE_EXPOSURE_TIME_1,
|
||||
name="Skin Type 1 Safe Exposure Time",
|
||||
name="Skin type 1 safe exposure time",
|
||||
icon="mdi:timer-outline",
|
||||
native_unit_of_measurement=TIME_MINUTES,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key=TYPE_SAFE_EXPOSURE_TIME_2,
|
||||
name="Skin Type 2 Safe Exposure Time",
|
||||
name="Skin type 2 safe exposure time",
|
||||
icon="mdi:timer-outline",
|
||||
native_unit_of_measurement=TIME_MINUTES,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key=TYPE_SAFE_EXPOSURE_TIME_3,
|
||||
name="Skin Type 3 Safe Exposure Time",
|
||||
name="Skin type 3 safe exposure time",
|
||||
icon="mdi:timer-outline",
|
||||
native_unit_of_measurement=TIME_MINUTES,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key=TYPE_SAFE_EXPOSURE_TIME_4,
|
||||
name="Skin Type 4 Safe Exposure Time",
|
||||
name="Skin type 4 safe exposure time",
|
||||
icon="mdi:timer-outline",
|
||||
native_unit_of_measurement=TIME_MINUTES,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key=TYPE_SAFE_EXPOSURE_TIME_5,
|
||||
name="Skin Type 5 Safe Exposure Time",
|
||||
name="Skin type 5 safe exposure time",
|
||||
icon="mdi:timer-outline",
|
||||
native_unit_of_measurement=TIME_MINUTES,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key=TYPE_SAFE_EXPOSURE_TIME_6,
|
||||
name="Skin Type 6 Safe Exposure Time",
|
||||
name="Skin type 6 safe exposure time",
|
||||
icon="mdi:timer-outline",
|
||||
native_unit_of_measurement=TIME_MINUTES,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
Loading…
x
Reference in New Issue
Block a user