From 89742dff7e0aa85a7564cb19e8ce6f752309cfa5 Mon Sep 17 00:00:00 2001 From: Simon Phipps <1368723+webmink@users.noreply.github.com> Date: Sat, 13 Apr 2024 00:36:32 +0100 Subject: [PATCH 1/3] Update octoprice_main_inky.py The low-res size was used here - probably a paste accident - so I've instead used the parameter so we get the right screen position --- octoprice_main_inky.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octoprice_main_inky.py b/octoprice_main_inky.py index 4a09066..071c742 100644 --- a/octoprice_main_inky.py +++ b/octoprice_main_inky.py @@ -351,7 +351,7 @@ #lowest_price_next_24h = min(i for i in prices if i > 0) lowest_price_next_24h = min(i for i in prices) if (lowest_price_next_24h < 0): - chart_base_loc = 104 + lowest_price_next_24h*pixels_per_h - 2 # if we have any negative prices, shift the base of the graph up! + chart_base_loc = chart_base_loc + lowest_price_next_24h*pixels_per_h - 2 # if we have any negative prices, shift the base of the graph up! print("lowest price Position:", prices.index(lowest_price_next_24h)) print("low Value:", lowest_price_next_24h) From 48e50cdcfa16ddb1a597f4364f99eb671b3f3221 Mon Sep 17 00:00:00 2001 From: Simon Phipps <1368723+webmink@users.noreply.github.com> Date: Sun, 21 Jul 2024 12:57:02 +0100 Subject: [PATCH 2/3] Update octoprice_main_inky.py Change last info line to show when the display was last updated so we can spot crashes more easily! --- octoprice_main_inky.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/octoprice_main_inky.py b/octoprice_main_inky.py index 071c742..045d485 100644 --- a/octoprice_main_inky.py +++ b/octoprice_main_inky.py @@ -395,9 +395,9 @@ time_of_cheapest = the_now_local + datetime.timedelta(minutes=min_offset) print("cheapest at " + str(time_of_cheapest)) print("which is: "+ str(time_of_cheapest.time())[0:5]) - time_of_cheapest_formatted = "at " + (str(time_of_cheapest.time())[0:5]) - font = ImageFont.truetype(FredokaOne, 16) - draw.text((right_column,101), time_of_cheapest_formatted, inky_display.BLACK, font) + time_of_cheapest_formatted = "Updated " + (str(the_now_local.time())[0:5]) + font = ImageFont.truetype(FredokaOne, 11) + draw.text((right_column,105), time_of_cheapest_formatted, inky_display.BLACK, font) # render the actual image onto the display From 729b1242863c729fdd506c653e0bb82c164b1eb4 Mon Sep 17 00:00:00 2001 From: Simon Phipps <1368723+webmink@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:38:15 +0100 Subject: [PATCH 3/3] Update README.md Set crontab to check for new tariff later as it's been arriving later... --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4072c7..dc1b5b0 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ You should see your display update with the current price! ``` @reboot sleep 10; cd /home/$USER/octopus-agile-pi-prices; /usr/bin/python3 octoprice_main_inky.py > /home/$USER/cron.log */30 * * * * sleep 20; cd /home/$USER/octopus-agile-pi-prices; /usr/bin/python3 octoprice_main_inky.py > /home/$USER/cron.log - 05 16 * * * cd /home/$USER/octopus-agile-pi-prices; /usr/bin/python3 store_prices.py -r -t > /home/$USER/cron.log + 25 16 * * * cd /home/$USER/octopus-agile-pi-prices; /usr/bin/python3 store_prices.py -r -t > /home/$USER/cron.log ``` Substituting the tariff and region as before.