Skip to content

Commit

Permalink
Fascia errata sabato notte; closes #37, closes #33
Browse files Browse the repository at this point in the history
  • Loading branch information
virtualdj committed Mar 10, 2024
1 parent 6b45125 commit 66d316e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions custom_components/pun_sensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,13 @@ def get_fascia(dataora: datetime) -> Tuple[int, datetime]:
# Prossima fascia: alle 23 dello stesso giorno
prossima = dataora.replace(hour=23,
minute=0, second=0, microsecond=0)
elif (dataora.hour < 7):
# Sabato tra le 0 e le 7
fascia = 3

# Prossima fascia: alle 7 dello stesso giorno
prossima = dataora.replace(hour=7,
minute=0, second=0, microsecond=0)
else:
# Sabato dopo le 23
fascia = 3
Expand Down
2 changes: 1 addition & 1 deletion custom_components/pun_sensor/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"issue_tracker": "https://github.com/virtualdj/pun_sensor/issues",
"loggers": ["pun_sensor"],
"requirements": ["holidays", "bs4"],
"version": "0.5.0"
"version": "0.6.0"
}

0 comments on commit 66d316e

Please sign in to comment.