From b232edc082795542602ffcd604924a3cb1d5f137 Mon Sep 17 00:00:00 2001 From: Maximilian Zettler Date: Thu, 24 Feb 2022 18:04:05 +0100 Subject: [PATCH] fix smart-punch multiple punch-in if not punching for the current day --- timebot/timebot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/timebot/timebot.py b/timebot/timebot.py index 1fa9834..02bf556 100644 --- a/timebot/timebot.py +++ b/timebot/timebot.py @@ -293,7 +293,11 @@ class TimeBot: self.mobatime_api.save_entry(punch_datetime, BREAK_END_ENTRY_CODE_ID, note="pause ende").raise_for_status() def smart_punch(self, punch_datetime): - last_punch = self.mobatime_api.get_entries(1, punch_datetime.replace(hour=0, minute=0, second=0, microsecond=0)) + last_punch = self.mobatime_api.get_entries( + 1, + start_date=punch_datetime.replace(hour=0, minute=0, second=0, microsecond=0), + end_date=punch_datetime.replace(hour=0, minute=0, second=0, microsecond=0), + ) method = None if not last_punch or last_punch[0]["entryNumber"] is None: self.logger.debug("could not detect any time entry for today... punching in")