Fix climacell/tomorrowio config flow test failure (#74660)

This commit is contained in:
J. Nick Koston 2022-07-07 15:45:40 -05:00 committed by GitHub
parent 3a61a0de2e
commit a84d92be4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -148,17 +148,16 @@ class BaseClimaCellWeatherEntity(ClimaCellEntity, WeatherEntity):
@property
def extra_state_attributes(self) -> Mapping[str, Any] | None:
"""Return additional state attributes."""
wind_gust = self.wind_gust
wind_gust = round(
speed_convert(self.wind_gust, SPEED_MILES_PER_HOUR, self._wind_speed_unit),
4,
)
cloud_cover = self.cloud_cover
return {
attrs = {
ATTR_CLOUD_COVER: cloud_cover,
ATTR_WIND_GUST: wind_gust,
ATTR_PRECIPITATION_TYPE: self.precipitation_type,
}
if (wind_gust := self.wind_gust) is not None:
attrs[ATTR_WIND_GUST] = round(
speed_convert(wind_gust, SPEED_MILES_PER_HOUR, self._wind_speed_unit), 4
)
return attrs
@property
@abstractmethod