diff --git a/custom_components/pun_sensor/__init__.py b/custom_components/pun_sensor/__init__.py index 1f255c1..7fd7d74 100644 --- a/custom_components/pun_sensor/__init__.py +++ b/custom_components/pun_sensor/__init__.py @@ -437,9 +437,9 @@ def get_fascia(dataora: datetime) -> Tuple[int, datetime]: fascia = 3 # Prossima fascia: alle 7 di un giorno non domenica o festività - prossima = (dataora + timedelta(days=1)).replace(hour=7, + prossima = dataora.replace(hour=7, minute=0, second=0, microsecond=0) - while ((prossima in holidays.IT()) or (prossima.weekday() == 6)): + while ((prossima <= dataora) or (prossima in holidays.IT()) or (prossima.weekday() == 6)): prossima += timedelta(days=1) else: diff --git a/custom_components/pun_sensor/manifest.json b/custom_components/pun_sensor/manifest.json index fa62479..ebfaf0d 100644 --- a/custom_components/pun_sensor/manifest.json +++ b/custom_components/pun_sensor/manifest.json @@ -10,5 +10,5 @@ "issue_tracker": "https://github.com/virtualdj/pun_sensor/issues", "loggers": ["pun_sensor"], "requirements": ["holidays", "bs4"], - "version": "0.4.0" + "version": "0.4.1" }