diff --git a/custom_components/yerushamayim/sensor.py b/custom_components/yerushamayim/sensor.py index a6afc75..0302f32 100644 --- a/custom_components/yerushamayim/sensor.py +++ b/custom_components/yerushamayim/sensor.py @@ -230,22 +230,9 @@ def icon(self): """Return the icon.""" return "mdi:weather-pouring" - # @property - # def precipitation_probability(self) -> int | None: - # """Return the precipitation probability""" - # try: - # return int(self.coordinator.data.precipitation["precipitation_probability"]) - # except (ValueError, KeyError, TypeError): - # return None - - # @property - # def extra_state_attributes(self): - # """Return the state attributes with numeric conversions for precipitation.""" - # attrs = super().extra_state_attributes - # for key in attrs: - # if key.endswith('_temp') and attrs[key] is not None: - # try: - # attrs[key] = float(attrs[key]) - # except (ValueError, TypeError): - # pass - # return attrs \ No newline at end of file + @property + def extra_state_attributes(self): + """Return the state attributes with numeric conversions for precipitation.""" + attrs = super().extra_state_attributes + attrs["precipitation_probability_unit"] = PERCENTAGE + return attrs \ No newline at end of file diff --git a/custom_components/yerushamayim/weather.py b/custom_components/yerushamayim/weather.py index 1df6954..d39f79d 100644 --- a/custom_components/yerushamayim/weather.py +++ b/custom_components/yerushamayim/weather.py @@ -109,7 +109,6 @@ async def async_forecast_daily(self) -> list[Forecast] | None: try: forecast = [Forecast( datetime=datetime.now().isoformat(), - condition=self.coordinator.data.status.get("condition"), native_temperature=float(self.coordinator.data.temperature["temperature"]), precipitation=float(self.coordinator.data.precipitation["precipitation"]), precipitation_probability=int(self.coordinator.data.precipitation["precipitation_probability"])