added TimeTrigger upon activation

This commit is contained in:
2025-03-09 17:30:36 +01:00
parent 76b8e3747b
commit f088b4ecaa
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -15,4 +15,10 @@ class TimeTrigger(Trigger):
return datetime.strptime(self.config.custom_config['endTime'], '%H:%M').time() return datetime.strptime(self.config.custom_config['endTime'], '%H:%M').time()
def run(self) -> None: 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
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "cpu_governor_auto_adjust" 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." description = "This application has been developed to automatically change cpu governor based on certain triggers."
authors = [ authors = [
{ name = "Martin Reurekas", email = "martin@semrks.nl" } { name = "Martin Reurekas", email = "martin@semrks.nl" }