Add icon translations to OpenUV (#111996)
Co-authored-by: Aaron Bach <bachya1208@gmail.com>
This commit is contained in:
parent
273e125859
commit
23480292c5
3 changed files with 38 additions and 10 deletions
|
@ -20,7 +20,6 @@ ATTR_PROTECTION_WINDOW_STARTING_UV = "start_uv"
|
|||
BINARY_SENSOR_DESCRIPTION_PROTECTION_WINDOW = BinarySensorEntityDescription(
|
||||
key=TYPE_PROTECTION_WINDOW,
|
||||
translation_key="protection_window",
|
||||
icon="mdi:sunglasses",
|
||||
)
|
||||
|
||||
|
||||
|
|
38
homeassistant/components/openuv/icons.json
Normal file
38
homeassistant/components/openuv/icons.json
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"protection_window": {
|
||||
"default": "mdi:sunglasses"
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"current_uv_index": {
|
||||
"default": "mdi:weather-sunny"
|
||||
},
|
||||
"current_uv_level": {
|
||||
"default": "mdi:weather-sunny"
|
||||
},
|
||||
"max_uv_index": {
|
||||
"default": "mdi:weather-sunny"
|
||||
},
|
||||
"skin_type_1_safe_exposure_time": {
|
||||
"default": "mdi:timer-outline"
|
||||
},
|
||||
"skin_type_2_safe_exposure_time": {
|
||||
"default": "mdi:timer-outline"
|
||||
},
|
||||
"skin_type_3_safe_exposure_time": {
|
||||
"default": "mdi:timer-outline"
|
||||
},
|
||||
"skin_type_4_safe_exposure_time": {
|
||||
"default": "mdi:timer-outline"
|
||||
},
|
||||
"skin_type_5_safe_exposure_time": {
|
||||
"default": "mdi:timer-outline"
|
||||
},
|
||||
"skin_type_6_safe_exposure_time": {
|
||||
"default": "mdi:timer-outline"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -89,7 +89,6 @@ SENSOR_DESCRIPTIONS = (
|
|||
OpenUvSensorEntityDescription(
|
||||
key=TYPE_CURRENT_UV_INDEX,
|
||||
translation_key="current_uv_index",
|
||||
icon="mdi:weather-sunny",
|
||||
native_unit_of_measurement=UV_INDEX,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value_fn=lambda data: data["uv"],
|
||||
|
@ -97,7 +96,6 @@ SENSOR_DESCRIPTIONS = (
|
|||
OpenUvSensorEntityDescription(
|
||||
key=TYPE_CURRENT_UV_LEVEL,
|
||||
translation_key="current_uv_level",
|
||||
icon="mdi:weather-sunny",
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
options=[label.value for label in UV_LABEL_DEFINITIONS],
|
||||
value_fn=lambda data: get_uv_label(data["uv"]),
|
||||
|
@ -105,7 +103,6 @@ SENSOR_DESCRIPTIONS = (
|
|||
OpenUvSensorEntityDescription(
|
||||
key=TYPE_MAX_UV_INDEX,
|
||||
translation_key="max_uv_index",
|
||||
icon="mdi:weather-sunny",
|
||||
native_unit_of_measurement=UV_INDEX,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value_fn=lambda data: data["uv_max"],
|
||||
|
@ -113,7 +110,6 @@ SENSOR_DESCRIPTIONS = (
|
|||
OpenUvSensorEntityDescription(
|
||||
key=TYPE_SAFE_EXPOSURE_TIME_1,
|
||||
translation_key="skin_type_1_safe_exposure_time",
|
||||
icon="mdi:timer-outline",
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value_fn=lambda data: data["safe_exposure_time"][
|
||||
|
@ -123,7 +119,6 @@ SENSOR_DESCRIPTIONS = (
|
|||
OpenUvSensorEntityDescription(
|
||||
key=TYPE_SAFE_EXPOSURE_TIME_2,
|
||||
translation_key="skin_type_2_safe_exposure_time",
|
||||
icon="mdi:timer-outline",
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value_fn=lambda data: data["safe_exposure_time"][
|
||||
|
@ -133,7 +128,6 @@ SENSOR_DESCRIPTIONS = (
|
|||
OpenUvSensorEntityDescription(
|
||||
key=TYPE_SAFE_EXPOSURE_TIME_3,
|
||||
translation_key="skin_type_3_safe_exposure_time",
|
||||
icon="mdi:timer-outline",
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value_fn=lambda data: data["safe_exposure_time"][
|
||||
|
@ -143,7 +137,6 @@ SENSOR_DESCRIPTIONS = (
|
|||
OpenUvSensorEntityDescription(
|
||||
key=TYPE_SAFE_EXPOSURE_TIME_4,
|
||||
translation_key="skin_type_4_safe_exposure_time",
|
||||
icon="mdi:timer-outline",
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value_fn=lambda data: data["safe_exposure_time"][
|
||||
|
@ -153,7 +146,6 @@ SENSOR_DESCRIPTIONS = (
|
|||
OpenUvSensorEntityDescription(
|
||||
key=TYPE_SAFE_EXPOSURE_TIME_5,
|
||||
translation_key="skin_type_5_safe_exposure_time",
|
||||
icon="mdi:timer-outline",
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value_fn=lambda data: data["safe_exposure_time"][
|
||||
|
@ -163,7 +155,6 @@ SENSOR_DESCRIPTIONS = (
|
|||
OpenUvSensorEntityDescription(
|
||||
key=TYPE_SAFE_EXPOSURE_TIME_6,
|
||||
translation_key="skin_type_6_safe_exposure_time",
|
||||
icon="mdi:timer-outline",
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value_fn=lambda data: data["safe_exposure_time"][
|
||||
|
|
Loading…
Add table
Reference in a new issue