Skip to content

Commit

Permalink
Merge pull request #60 from bruxy70/development
Browse files Browse the repository at this point in the history
Update sensor.py
  • Loading branch information
bruxy70 authored Dec 27, 2019
2 parents 817229a + 68d9cd5 commit 7baf4eb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions custom_components/garbage_collection/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,18 +329,17 @@ async def async_update(self) -> None:
if self.date_inside(today):
next_date = self.get_next_date(today)
if next_date is not None:
next_date_year = next_date.year
if not self.date_inside(next_date):
if self.__first_month <= self.__last_month:
next_year = date(next_date_year + 1, self.__first_month, 1)
next_year = date(year + 1, self.__first_month, 1)
next_date = self.get_next_date(next_year)
_LOGGER.debug(
"(%s) Did not find the date this year, "
"lookig at next year",
self.__name,
)
else:
next_year = date(next_date_year, self.__first_month, 1)
next_year = date(year, self.__first_month, 1)
next_date = self.get_next_date(next_year)
_LOGGER.debug(
"(%s) Arrived to the end of date range, "
Expand Down

0 comments on commit 7baf4eb

Please sign in to comment.