Skip to content

Commit

Permalink
Align changes from version 0.34.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyKh committed Oct 10, 2024
1 parent 1e5d779 commit 29500ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions custom_components/ims/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"documentation": "https://github.com/GuyKh/ims-custom-component",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/GuyKh/ims-custom-component/issues",
"requirements": ["weatheril>=0.33.0"],
"version": "0.1.28"
"requirements": ["weatheril>=0.34.0"],
"version": "0.1.29"
}
1 change: 0 additions & 1 deletion custom_components/ims/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
SENSOR_DESCRIPTIONS_KEYS = [desc.key for desc in SENSOR_DESCRIPTIONS]

weather = None
timezone = dt_util.get_time_zone('Asia/Jerusalem')

async def async_setup_platform(hass, config_entry, async_add_entities, discovery_info=None):
_LOGGER.warning(
Expand Down
6 changes: 2 additions & 4 deletions custom_components/ims/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ def round_if_needed(value: int | float, output_round: bool):
else:
return round(value, 2)

timezone = dt_util.get_time_zone('Asia/Jerusalem')

class IMSWeather(WeatherEntity):
"""Implementation of an IMSWeather sensor."""

Expand Down Expand Up @@ -243,7 +241,7 @@ def _forecast(self, hourly: bool) -> list[Forecast]:
data = [
Forecast(
condition=WEATHER_CODE_TO_CONDITION[daily_forecast.weather_code],
datetime=daily_forecast.date.astimezone(pytz.UTC).isoformat(),
datetime=daily_forecast.date.isoformat(),
native_temperature=daily_forecast.maximum_temperature,
native_templow=daily_forecast.minimum_temperature
) for daily_forecast in self._weather_coordinator.data.forecast.days
Expand All @@ -262,7 +260,7 @@ def _forecast(self, hourly: bool) -> list[Forecast]:
data.append(
Forecast(
condition=WEATHER_CODE_TO_CONDITION[hourly_weather_code],
datetime=hourly_forecast.forecast_time.astimezone(timezone).isoformat(),
datetime=hourly_forecast.forecast_time.isoformat(),
native_temperature=hourly_forecast.precise_temperature,
native_templow=daily_forecast.minimum_temperature,
native_precipitation=hourly_forecast.rain,
Expand Down

0 comments on commit 29500ad

Please sign in to comment.