Align weatherflow_cloud weather conditions with Home Assistant supported conditions (#114497)
* WeatherFlow Cloud changing icon mapping specificaly for Colorado * changing name to state_mappull/119053/head
parent
7947f63860
commit
4600960895
|
@ -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",
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue