mirror of
https://github.com/home-assistant/core.git
synced 2025-07-11 15:27:08 +00:00
Add icon translations to AccuWeather (#119134)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
This commit is contained in:
parent
27df79daf1
commit
cb672b85f4
51
homeassistant/components/accuweather/icons.json
Normal file
51
homeassistant/components/accuweather/icons.json
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
"entity": {
|
||||||
|
"sensor": {
|
||||||
|
"cloud_ceiling": {
|
||||||
|
"default": "mdi:weather-fog"
|
||||||
|
},
|
||||||
|
"cloud_cover": {
|
||||||
|
"default": "mdi:weather-cloudy"
|
||||||
|
},
|
||||||
|
"cloud_cover_day": {
|
||||||
|
"default": "mdi:weather-cloudy"
|
||||||
|
},
|
||||||
|
"cloud_cover_night": {
|
||||||
|
"default": "mdi:weather-cloudy"
|
||||||
|
},
|
||||||
|
"grass_pollen": {
|
||||||
|
"default": "mdi:grass"
|
||||||
|
},
|
||||||
|
"hours_of_sun": {
|
||||||
|
"default": "mdi:weather-partly-cloudy"
|
||||||
|
},
|
||||||
|
"mold_pollen": {
|
||||||
|
"default": "mdi:blur"
|
||||||
|
},
|
||||||
|
"pressure_tendency": {
|
||||||
|
"default": "mdi:gauge"
|
||||||
|
},
|
||||||
|
"ragweed_pollen": {
|
||||||
|
"default": "mdi:sprout"
|
||||||
|
},
|
||||||
|
"thunderstorm_probability_day": {
|
||||||
|
"default": "mdi:weather-lightning"
|
||||||
|
},
|
||||||
|
"thunderstorm_probability_night": {
|
||||||
|
"default": "mdi:weather-lightning"
|
||||||
|
},
|
||||||
|
"translation_key": {
|
||||||
|
"default": "mdi:air-filter"
|
||||||
|
},
|
||||||
|
"tree_pollen": {
|
||||||
|
"default": "mdi:tree-outline"
|
||||||
|
},
|
||||||
|
"uv_index": {
|
||||||
|
"default": "mdi:weather-sunny"
|
||||||
|
},
|
||||||
|
"uv_index_forecast": {
|
||||||
|
"default": "mdi:weather-sunny"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -58,7 +58,6 @@ class AccuWeatherSensorDescription(SensorEntityDescription):
|
|||||||
FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="AirQuality",
|
key="AirQuality",
|
||||||
icon="mdi:air-filter",
|
|
||||||
value_fn=lambda data: cast(str, data[ATTR_CATEGORY]),
|
value_fn=lambda data: cast(str, data[ATTR_CATEGORY]),
|
||||||
device_class=SensorDeviceClass.ENUM,
|
device_class=SensorDeviceClass.ENUM,
|
||||||
options=["good", "hazardous", "high", "low", "moderate", "unhealthy"],
|
options=["good", "hazardous", "high", "low", "moderate", "unhealthy"],
|
||||||
@ -66,7 +65,6 @@ FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
|||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="CloudCoverDay",
|
key="CloudCoverDay",
|
||||||
icon="mdi:weather-cloudy",
|
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
value_fn=lambda data: cast(int, data),
|
value_fn=lambda data: cast(int, data),
|
||||||
@ -74,7 +72,6 @@ FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
|||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="CloudCoverNight",
|
key="CloudCoverNight",
|
||||||
icon="mdi:weather-cloudy",
|
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
value_fn=lambda data: cast(int, data),
|
value_fn=lambda data: cast(int, data),
|
||||||
@ -82,7 +79,6 @@ FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
|||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="Grass",
|
key="Grass",
|
||||||
icon="mdi:grass",
|
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
native_unit_of_measurement=CONCENTRATION_PARTS_PER_CUBIC_METER,
|
native_unit_of_measurement=CONCENTRATION_PARTS_PER_CUBIC_METER,
|
||||||
value_fn=lambda data: cast(int, data[ATTR_VALUE]),
|
value_fn=lambda data: cast(int, data[ATTR_VALUE]),
|
||||||
@ -91,7 +87,6 @@ FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
|||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="HoursOfSun",
|
key="HoursOfSun",
|
||||||
icon="mdi:weather-partly-cloudy",
|
|
||||||
native_unit_of_measurement=UnitOfTime.HOURS,
|
native_unit_of_measurement=UnitOfTime.HOURS,
|
||||||
value_fn=lambda data: cast(float, data),
|
value_fn=lambda data: cast(float, data),
|
||||||
translation_key="hours_of_sun",
|
translation_key="hours_of_sun",
|
||||||
@ -108,7 +103,6 @@ FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
|||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="Mold",
|
key="Mold",
|
||||||
icon="mdi:blur",
|
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
native_unit_of_measurement=CONCENTRATION_PARTS_PER_CUBIC_METER,
|
native_unit_of_measurement=CONCENTRATION_PARTS_PER_CUBIC_METER,
|
||||||
value_fn=lambda data: cast(int, data[ATTR_VALUE]),
|
value_fn=lambda data: cast(int, data[ATTR_VALUE]),
|
||||||
@ -117,7 +111,6 @@ FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
|||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="Ragweed",
|
key="Ragweed",
|
||||||
icon="mdi:sprout",
|
|
||||||
native_unit_of_measurement=CONCENTRATION_PARTS_PER_CUBIC_METER,
|
native_unit_of_measurement=CONCENTRATION_PARTS_PER_CUBIC_METER,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_fn=lambda data: cast(int, data[ATTR_VALUE]),
|
value_fn=lambda data: cast(int, data[ATTR_VALUE]),
|
||||||
@ -156,7 +149,7 @@ FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
|||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="SolarIrradianceDay",
|
key="SolarIrradianceDay",
|
||||||
icon="mdi:weather-sunny",
|
device_class=SensorDeviceClass.IRRADIANCE,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
native_unit_of_measurement=UnitOfIrradiance.WATTS_PER_SQUARE_METER,
|
native_unit_of_measurement=UnitOfIrradiance.WATTS_PER_SQUARE_METER,
|
||||||
value_fn=lambda data: cast(float, data[ATTR_VALUE]),
|
value_fn=lambda data: cast(float, data[ATTR_VALUE]),
|
||||||
@ -164,7 +157,7 @@ FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
|||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="SolarIrradianceNight",
|
key="SolarIrradianceNight",
|
||||||
icon="mdi:weather-sunny",
|
device_class=SensorDeviceClass.IRRADIANCE,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
native_unit_of_measurement=UnitOfIrradiance.WATTS_PER_SQUARE_METER,
|
native_unit_of_measurement=UnitOfIrradiance.WATTS_PER_SQUARE_METER,
|
||||||
value_fn=lambda data: cast(float, data[ATTR_VALUE]),
|
value_fn=lambda data: cast(float, data[ATTR_VALUE]),
|
||||||
@ -172,21 +165,18 @@ FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
|||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="ThunderstormProbabilityDay",
|
key="ThunderstormProbabilityDay",
|
||||||
icon="mdi:weather-lightning",
|
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
value_fn=lambda data: cast(int, data),
|
value_fn=lambda data: cast(int, data),
|
||||||
translation_key="thunderstorm_probability_day",
|
translation_key="thunderstorm_probability_day",
|
||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="ThunderstormProbabilityNight",
|
key="ThunderstormProbabilityNight",
|
||||||
icon="mdi:weather-lightning",
|
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
value_fn=lambda data: cast(int, data),
|
value_fn=lambda data: cast(int, data),
|
||||||
translation_key="thunderstorm_probability_night",
|
translation_key="thunderstorm_probability_night",
|
||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="Tree",
|
key="Tree",
|
||||||
icon="mdi:tree-outline",
|
|
||||||
native_unit_of_measurement=CONCENTRATION_PARTS_PER_CUBIC_METER,
|
native_unit_of_measurement=CONCENTRATION_PARTS_PER_CUBIC_METER,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
value_fn=lambda data: cast(int, data[ATTR_VALUE]),
|
value_fn=lambda data: cast(int, data[ATTR_VALUE]),
|
||||||
@ -195,7 +185,6 @@ FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
|||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="UVIndex",
|
key="UVIndex",
|
||||||
icon="mdi:weather-sunny",
|
|
||||||
native_unit_of_measurement=UV_INDEX,
|
native_unit_of_measurement=UV_INDEX,
|
||||||
value_fn=lambda data: cast(int, data[ATTR_VALUE]),
|
value_fn=lambda data: cast(int, data[ATTR_VALUE]),
|
||||||
attr_fn=lambda data: {ATTR_LEVEL: data[ATTR_CATEGORY]},
|
attr_fn=lambda data: {ATTR_LEVEL: data[ATTR_CATEGORY]},
|
||||||
@ -250,7 +239,6 @@ SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
|||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="Ceiling",
|
key="Ceiling",
|
||||||
device_class=SensorDeviceClass.DISTANCE,
|
device_class=SensorDeviceClass.DISTANCE,
|
||||||
icon="mdi:weather-fog",
|
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=UnitOfLength.METERS,
|
native_unit_of_measurement=UnitOfLength.METERS,
|
||||||
value_fn=lambda data: cast(float, data[API_METRIC][ATTR_VALUE]),
|
value_fn=lambda data: cast(float, data[API_METRIC][ATTR_VALUE]),
|
||||||
@ -259,7 +247,6 @@ SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
|||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="CloudCover",
|
key="CloudCover",
|
||||||
icon="mdi:weather-cloudy",
|
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
@ -304,14 +291,12 @@ SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
|
|||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="PressureTendency",
|
key="PressureTendency",
|
||||||
device_class=SensorDeviceClass.ENUM,
|
device_class=SensorDeviceClass.ENUM,
|
||||||
icon="mdi:gauge",
|
|
||||||
options=["falling", "rising", "steady"],
|
options=["falling", "rising", "steady"],
|
||||||
value_fn=lambda data: cast(str, data["LocalizedText"]).lower(),
|
value_fn=lambda data: cast(str, data["LocalizedText"]).lower(),
|
||||||
translation_key="pressure_tendency",
|
translation_key="pressure_tendency",
|
||||||
),
|
),
|
||||||
AccuWeatherSensorDescription(
|
AccuWeatherSensorDescription(
|
||||||
key="UVIndex",
|
key="UVIndex",
|
||||||
icon="mdi:weather-sunny",
|
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=UV_INDEX,
|
native_unit_of_measurement=UV_INDEX,
|
||||||
value_fn=lambda data: cast(int, data),
|
value_fn=lambda data: cast(int, data),
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user