mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Add some weather attribute icons and units (#21133)
This commit is contained in:
parent
5ddf72b973
commit
362e92f313
@ -1,6 +1,9 @@
|
|||||||
import {
|
import {
|
||||||
mdiAlertCircleOutline,
|
mdiAlertCircleOutline,
|
||||||
mdiGauge,
|
mdiGauge,
|
||||||
|
mdiThermometer,
|
||||||
|
mdiThermometerWater,
|
||||||
|
mdiSunWireless,
|
||||||
mdiWaterPercent,
|
mdiWaterPercent,
|
||||||
mdiWeatherCloudy,
|
mdiWeatherCloudy,
|
||||||
mdiWeatherFog,
|
mdiWeatherFog,
|
||||||
@ -114,10 +117,15 @@ export const weatherIcons = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const weatherAttrIcons = {
|
export const weatherAttrIcons = {
|
||||||
|
apparent_temperature: mdiThermometer,
|
||||||
|
cloud_coverage: mdiWeatherCloudy,
|
||||||
|
dew_point: mdiThermometerWater,
|
||||||
humidity: mdiWaterPercent,
|
humidity: mdiWaterPercent,
|
||||||
wind_bearing: mdiWeatherWindy,
|
wind_bearing: mdiWeatherWindy,
|
||||||
wind_speed: mdiWeatherWindy,
|
wind_speed: mdiWeatherWindy,
|
||||||
pressure: mdiGauge,
|
pressure: mdiGauge,
|
||||||
|
temperature: mdiThermometer,
|
||||||
|
uv_index: mdiSunWireless,
|
||||||
visibility: mdiWeatherFog,
|
visibility: mdiWeatherFog,
|
||||||
precipitation: mdiWeatherRainy,
|
precipitation: mdiWeatherRainy,
|
||||||
};
|
};
|
||||||
@ -221,6 +229,8 @@ export const getWeatherUnit = (
|
|||||||
stateObj.attributes.pressure_unit ||
|
stateObj.attributes.pressure_unit ||
|
||||||
(lengthUnit === "km" ? "hPa" : "inHg")
|
(lengthUnit === "km" ? "hPa" : "inHg")
|
||||||
);
|
);
|
||||||
|
case "apparent_temperature":
|
||||||
|
case "dew_point":
|
||||||
case "temperature":
|
case "temperature":
|
||||||
case "templow":
|
case "templow":
|
||||||
return (
|
return (
|
||||||
@ -228,6 +238,7 @@ export const getWeatherUnit = (
|
|||||||
);
|
);
|
||||||
case "wind_speed":
|
case "wind_speed":
|
||||||
return stateObj.attributes.wind_speed_unit || `${lengthUnit}/h`;
|
return stateObj.attributes.wind_speed_unit || `${lengthUnit}/h`;
|
||||||
|
case "cloud_coverage":
|
||||||
case "humidity":
|
case "humidity":
|
||||||
case "precipitation_probability":
|
case "precipitation_probability":
|
||||||
return "%";
|
return "%";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user