Skip to content

Commit

Permalink
Add some weather attribute icons and units (#21133)
Browse files Browse the repository at this point in the history
  • Loading branch information
karwosts authored Jun 22, 2024
1 parent 5ddf72b commit 362e92f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/data/weather.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import {
mdiAlertCircleOutline,
mdiGauge,
mdiThermometer,
mdiThermometerWater,
mdiSunWireless,
mdiWaterPercent,
mdiWeatherCloudy,
mdiWeatherFog,
Expand Down Expand Up @@ -114,10 +117,15 @@ export const weatherIcons = {
};

export const weatherAttrIcons = {
apparent_temperature: mdiThermometer,
cloud_coverage: mdiWeatherCloudy,
dew_point: mdiThermometerWater,
humidity: mdiWaterPercent,
wind_bearing: mdiWeatherWindy,
wind_speed: mdiWeatherWindy,
pressure: mdiGauge,
temperature: mdiThermometer,
uv_index: mdiSunWireless,
visibility: mdiWeatherFog,
precipitation: mdiWeatherRainy,
};
Expand Down Expand Up @@ -221,13 +229,16 @@ export const getWeatherUnit = (
stateObj.attributes.pressure_unit ||
(lengthUnit === "km" ? "hPa" : "inHg")
);
case "apparent_temperature":
case "dew_point":
case "temperature":
case "templow":
return (
stateObj.attributes.temperature_unit || config.unit_system.temperature
);
case "wind_speed":
return stateObj.attributes.wind_speed_unit || `${lengthUnit}/h`;
case "cloud_coverage":
case "humidity":
case "precipitation_probability":
return "%";
Expand Down

0 comments on commit 362e92f

Please sign in to comment.