Skip to content

Commit e01bbcd

Browse files
committed
🔧 minor tweaks
- si la note est vide ça signifie que la catégorie a changé en termes de pondération / d'organisation - réduction des scans inutiles, on scan entre minuit et 3H du matin, et on scan tte les 2 minutes de 1H20 à 1H40 (le changement serveur arrive généralement vers 1H28)
1 parent e4b22fd commit e01bbcd

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ def send_notification(change):
7373
text = f"➡️ Note: {note} - Pondération: {ponderation}"
7474
else:
7575
text = f"➡️ Note: {note}"
76+
if not note:
77+
text = "🛠️ Modification de la pondération"
7678
print(f"Note : {title} - {text}")
7779
try:
7880
if NTFY_AUTH:
@@ -132,14 +134,16 @@ def main():
132134
interval = 30
133135
else:
134136
# Si on est hors de la plage minuit-7h, on attend jusqu'à minuit
135-
if not (0 <= now.hour < 7):
137+
if not (0 <= now.hour < 3):
136138
next_midnight = (now + datetime.timedelta(days=1)).replace(hour=0, minute=0, second=0, microsecond=0)
137139
sleep_seconds = (next_midnight - now).total_seconds()
138140
print(f"Hors plage horaire, dodo jusqu'à minuit ({next_midnight.strftime('%Y-%m-%d %H:%M:%S')})")
139141
time.sleep(sleep_seconds)
140142
continue
141143
interval = CHECK_INTERVAL
142-
if 1 <= get_tz_time().hour < 1.5: # Si on est entre 1h et 1h30, on attend 2 minutes
144+
# Si on est entre 1h20 et 1h40, on attend 2 minutes
145+
now_tz = get_tz_time()
146+
if now_tz.hour == 1 and 20 <= now_tz.minute < 40:
143147
interval = 120
144148

145149
# Récupérer le contenu des notes

0 commit comments

Comments
 (0)