mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 00:07:10 +00:00
Add icon translations to Airnow (#108403)
This commit is contained in:
parent
2f227677b6
commit
3a6e640c73
18
homeassistant/components/airnow/icons.json
Normal file
18
homeassistant/components/airnow/icons.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"entity": {
|
||||||
|
"sensor": {
|
||||||
|
"aqi": {
|
||||||
|
"default": "mdi:blur"
|
||||||
|
},
|
||||||
|
"pm25": {
|
||||||
|
"default": "mdi:blur"
|
||||||
|
},
|
||||||
|
"o3": {
|
||||||
|
"default": "mdi:blur"
|
||||||
|
},
|
||||||
|
"station": {
|
||||||
|
"default": "mdi:blur"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -77,7 +77,7 @@ def station_extra_attrs(data: dict[str, Any]) -> dict[str, Any]:
|
|||||||
SENSOR_TYPES: tuple[AirNowEntityDescription, ...] = (
|
SENSOR_TYPES: tuple[AirNowEntityDescription, ...] = (
|
||||||
AirNowEntityDescription(
|
AirNowEntityDescription(
|
||||||
key=ATTR_API_AQI,
|
key=ATTR_API_AQI,
|
||||||
icon="mdi:blur",
|
translation_key="aqi",
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
device_class=SensorDeviceClass.AQI,
|
device_class=SensorDeviceClass.AQI,
|
||||||
value_fn=lambda data: data.get(ATTR_API_AQI),
|
value_fn=lambda data: data.get(ATTR_API_AQI),
|
||||||
@ -94,7 +94,7 @@ SENSOR_TYPES: tuple[AirNowEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
AirNowEntityDescription(
|
AirNowEntityDescription(
|
||||||
key=ATTR_API_PM25,
|
key=ATTR_API_PM25,
|
||||||
icon="mdi:blur",
|
translation_key="pm25",
|
||||||
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
device_class=SensorDeviceClass.PM25,
|
device_class=SensorDeviceClass.PM25,
|
||||||
@ -104,7 +104,6 @@ SENSOR_TYPES: tuple[AirNowEntityDescription, ...] = (
|
|||||||
AirNowEntityDescription(
|
AirNowEntityDescription(
|
||||||
key=ATTR_API_O3,
|
key=ATTR_API_O3,
|
||||||
translation_key="o3",
|
translation_key="o3",
|
||||||
icon="mdi:blur",
|
|
||||||
native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
|
native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
value_fn=lambda data: data.get(ATTR_API_O3),
|
value_fn=lambda data: data.get(ATTR_API_O3),
|
||||||
@ -113,7 +112,6 @@ SENSOR_TYPES: tuple[AirNowEntityDescription, ...] = (
|
|||||||
AirNowEntityDescription(
|
AirNowEntityDescription(
|
||||||
key=ATTR_API_STATION,
|
key=ATTR_API_STATION,
|
||||||
translation_key="station",
|
translation_key="station",
|
||||||
icon="mdi:blur",
|
|
||||||
value_fn=lambda data: data.get(ATTR_API_STATION),
|
value_fn=lambda data: data.get(ATTR_API_STATION),
|
||||||
extra_state_attributes_fn=station_extra_attrs,
|
extra_state_attributes_fn=station_extra_attrs,
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user