Align weatherflow_cloud weather conditions with Home Assistant supported conditions (#114497)

* WeatherFlow Cloud changing icon mapping specificaly for Colorado

* changing name to state_map
pull/119053/head
Jeef 2024-06-07 05:02:41 -04:00 committed by GitHub
parent 7947f63860
commit 4600960895
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 2 deletions

View File

@ -7,3 +7,25 @@ LOGGER = logging.getLogger(__package__)
ATTR_ATTRIBUTION = "Weather data delivered by WeatherFlow/Tempest REST Api"
MANUFACTURER = "WeatherFlow"
STATE_MAP = {
"clear-day": "sunny",
"clear-night": "clear-night",
"cloudy": "cloudy",
"foggy": "fog",
"partly-cloudy-day": "partlycloudy",
"partly-cloudy-night": "partlycloudy",
"possibly-rainy-day": "rainy",
"possibly-rainy-night": "rainy",
"possibly-sleet-day": "snowy-rainy",
"possibly-sleet-night": "snowy-rainy",
"possibly-snow-day": "snowy",
"possibly-snow-night": "snowy",
"possibly-thunderstorm-day": "lightning-rainy",
"possibly-thunderstorm-night": "lightning-rainy",
"rainy": "rainy",
"sleet": "snowy-rainy",
"snow": "snowy",
"thunderstorm": "lightning",
"windy": "windy",
}

View File

@ -20,7 +20,7 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import ATTR_ATTRIBUTION, DOMAIN, MANUFACTURER
from .const import ATTR_ATTRIBUTION, DOMAIN, MANUFACTURER, STATE_MAP
from .coordinator import WeatherFlowCloudDataUpdateCoordinator
@ -86,7 +86,7 @@ class WeatherFlowWeather(
@property
def condition(self) -> str | None:
"""Return current condition - required property."""
return self.local_data.weather.current_conditions.icon.ha_icon
return STATE_MAP[self.local_data.weather.current_conditions.icon.value]
@property
def native_temperature(self) -> float | None: