diff --git a/cpu_governor_auto_adjust/triggers/time.py b/cpu_governor_auto_adjust/triggers/time.py index 0ed5c7d..a49d93c 100644 --- a/cpu_governor_auto_adjust/triggers/time.py +++ b/cpu_governor_auto_adjust/triggers/time.py @@ -15,4 +15,10 @@ class TimeTrigger(Trigger): return datetime.strptime(self.config.custom_config['endTime'], '%H:%M').time() def run(self) -> None: - self.active = self.start_time() <= datetime.now().time() <= self.end_time() + active_current = self.active + active_new = self.start_time() <= datetime.now().time() <= self.end_time() + if not active_current and active_new: + self.log.info("activating trigger, start time: %s, end time: %s, governor: %s", self.start_time(), self.end_time(), self.governor.name) + elif active_current and not active_new: + self.log.info("deactivating trigger, start time: %s, end time: %s, governor: %s", self.start_time(), self.end_time(), self.governor.name) + self.active = active_new diff --git a/pyproject.toml b/pyproject.toml index e91589e..eb021c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cpu_governor_auto_adjust" -version = "0.1.33" +version = "0.1.34" description = "This application has been developed to automatically change cpu governor based on certain triggers." authors = [ { name = "Martin Reurekas", email = "martin@semrks.nl" }