Add icon translations to Weatherflow (#112353)

This commit is contained in:
Joost Lekkerkerker 2024-03-06 06:30:46 +01:00 committed by GitHub
parent 9d89adb3d0
commit 102dbdabb5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 11 deletions

View file

@ -0,0 +1,21 @@
{
"entity": {
"sensor": {
"lightning_average_distance": {
"default": "mdi:lightning-bolt"
},
"lightning_count": {
"default": "mdi:lightning-bolt"
},
"precipitation_type": {
"default": "mdi:weather-rainy"
},
"wind_direction": {
"default": "mdi:compass-outline"
},
"wind_direction_average": {
"default": "mdi:compass-outline"
}
}
}
}

View file

@ -138,7 +138,6 @@ SENSORS: tuple[WeatherFlowSensorEntityDescription, ...] = (
),
WeatherFlowSensorEntityDescription(
key="lightning_strike_average_distance",
icon="mdi:lightning-bolt",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.DISTANCE,
native_unit_of_measurement=UnitOfLength.KILOMETERS,
@ -149,7 +148,6 @@ SENSORS: tuple[WeatherFlowSensorEntityDescription, ...] = (
WeatherFlowSensorEntityDescription(
key="lightning_strike_count",
translation_key="lightning_count",
icon="mdi:lightning-bolt",
state_class=SensorStateClass.TOTAL,
raw_data_conv_fn=lambda raw_data: raw_data,
),
@ -158,12 +156,10 @@ SENSORS: tuple[WeatherFlowSensorEntityDescription, ...] = (
translation_key="precipitation_type",
device_class=SensorDeviceClass.ENUM,
options=["none", "rain", "hail", "rain_hail", "unknown"],
icon="mdi:weather-rainy",
raw_data_conv_fn=precipitation_raw_conversion_fn,
),
WeatherFlowSensorEntityDescription(
key="rain_accumulation_previous_minute",
icon="mdi:weather-rainy",
native_unit_of_measurement=UnitOfPrecipitationDepth.MILLIMETERS,
state_class=SensorStateClass.TOTAL,
device_class=SensorDeviceClass.PRECIPITATION,
@ -174,7 +170,6 @@ SENSORS: tuple[WeatherFlowSensorEntityDescription, ...] = (
key="rain_rate",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
icon="mdi:weather-rainy",
native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
raw_data_conv_fn=lambda raw_data: raw_data.magnitude,
),
@ -242,7 +237,6 @@ SENSORS: tuple[WeatherFlowSensorEntityDescription, ...] = (
WeatherFlowSensorEntityDescription(
key="wind_gust",
translation_key="wind_gust",
icon="mdi:weather-windy",
device_class=SensorDeviceClass.WIND_SPEED,
native_unit_of_measurement=UnitOfSpeed.METERS_PER_SECOND,
state_class=SensorStateClass.MEASUREMENT,
@ -252,7 +246,6 @@ SENSORS: tuple[WeatherFlowSensorEntityDescription, ...] = (
WeatherFlowSensorEntityDescription(
key="wind_lull",
translation_key="wind_lull",
icon="mdi:weather-windy",
device_class=SensorDeviceClass.WIND_SPEED,
native_unit_of_measurement=UnitOfSpeed.METERS_PER_SECOND,
state_class=SensorStateClass.MEASUREMENT,
@ -262,7 +255,6 @@ SENSORS: tuple[WeatherFlowSensorEntityDescription, ...] = (
WeatherFlowSensorEntityDescription(
key="wind_speed",
device_class=SensorDeviceClass.WIND_SPEED,
icon="mdi:weather-windy",
event_subscriptions=[EVENT_RAPID_WIND, EVENT_OBSERVATION],
native_unit_of_measurement=UnitOfSpeed.METERS_PER_SECOND,
state_class=SensorStateClass.MEASUREMENT,
@ -272,7 +264,6 @@ SENSORS: tuple[WeatherFlowSensorEntityDescription, ...] = (
WeatherFlowSensorEntityDescription(
key="wind_average",
translation_key="wind_speed_average",
icon="mdi:weather-windy",
device_class=SensorDeviceClass.WIND_SPEED,
native_unit_of_measurement=UnitOfSpeed.METERS_PER_SECOND,
state_class=SensorStateClass.MEASUREMENT,
@ -282,7 +273,6 @@ SENSORS: tuple[WeatherFlowSensorEntityDescription, ...] = (
WeatherFlowSensorEntityDescription(
key="wind_direction",
translation_key="wind_direction",
icon="mdi:compass-outline",
native_unit_of_measurement=DEGREE,
state_class=SensorStateClass.MEASUREMENT,
event_subscriptions=[EVENT_RAPID_WIND, EVENT_OBSERVATION],
@ -291,7 +281,6 @@ SENSORS: tuple[WeatherFlowSensorEntityDescription, ...] = (
WeatherFlowSensorEntityDescription(
key="wind_direction_average",
translation_key="wind_direction_average",
icon="mdi:compass-outline",
native_unit_of_measurement=DEGREE,
state_class=SensorStateClass.MEASUREMENT,
raw_data_conv_fn=lambda raw_data: raw_data.magnitude,