From 5ff6bc7690d05cd3074d8a9e98fa32ed6767490f Mon Sep 17 00:00:00 2001 From: Peter Hofman Date: Mon, 18 May 2020 13:15:16 +0200 Subject: [PATCH 1/3] Auto capture daily screen on the whole hour. --- piweatherrock/runner.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/piweatherrock/runner.py b/piweatherrock/runner.py index 508a50f..7dfc7ec 100644 --- a/piweatherrock/runner.py +++ b/piweatherrock/runner.py @@ -36,6 +36,7 @@ def __init__(self): self.daily = None self.hourly = None self.info = None + self.hourcap = 0 def main(self, config_file): with open(config_file, "r") as f: @@ -179,6 +180,10 @@ def screen_switcher(self): if self.seconds != time.localtime().tm_sec: self.seconds = time.localtime().tm_sec self.daily.disp_daily(self.my_weather_rock) + # At first Daily screen of the new hour, capture it + if time.localtime().tm_hour != self.hourcap: + self.my_weather_rock.screen_cap() + self.hourcap = time.localtime().tm_hour # Once the screen is updated, we have a full second to get the # weather. Once per minute, check to see if its time to get a From 958006c2f4ccd24668819eea41a89b70fc65298e Mon Sep 17 00:00:00 2001 From: Peter Hofman Date: Thu, 28 May 2020 08:43:57 +0200 Subject: [PATCH 2/3] Boolean to choose for auto screencap --- piweatherrock/runner.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/piweatherrock/runner.py b/piweatherrock/runner.py index 7dfc7ec..0502f13 100644 --- a/piweatherrock/runner.py +++ b/piweatherrock/runner.py @@ -37,6 +37,7 @@ def __init__(self): self.hourly = None self.info = None self.hourcap = 0 + self.caphour = False def main(self, config_file): with open(config_file, "r") as f: @@ -181,9 +182,10 @@ def screen_switcher(self): self.seconds = time.localtime().tm_sec self.daily.disp_daily(self.my_weather_rock) # At first Daily screen of the new hour, capture it - if time.localtime().tm_hour != self.hourcap: - self.my_weather_rock.screen_cap() - self.hourcap = time.localtime().tm_hour + if self.caphour: + if time.localtime().tm_hour != self.hourcap: + self.my_weather_rock.screen_cap() + self.hourcap = time.localtime().tm_hour # Once the screen is updated, we have a full second to get the # weather. Once per minute, check to see if its time to get a From a111b45179a4345236ea68a89741383b87a03cbe Mon Sep 17 00:00:00 2001 From: Peter Hofman Date: Thu, 28 May 2020 14:36:27 +0200 Subject: [PATCH 3/3] typo --- piweatherrock/runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piweatherrock/runner.py b/piweatherrock/runner.py index 0502f13..f32ccf6 100644 --- a/piweatherrock/runner.py +++ b/piweatherrock/runner.py @@ -182,7 +182,7 @@ def screen_switcher(self): self.seconds = time.localtime().tm_sec self.daily.disp_daily(self.my_weather_rock) # At first Daily screen of the new hour, capture it - if self.caphour: + if self.config["caphour"]: if time.localtime().tm_hour != self.hourcap: self.my_weather_rock.screen_cap() self.hourcap = time.localtime().tm_hour