jerbzz / pi-eco-indicator

Display at-a-glance data of carbon intensity or Octopus Agile prices on a Pimoroni Blinkt! display or a Pimoroni Inky pHAT display.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

update_display.py fails to run when mode is changed in config file and new data is not fetched

jerbzz opened this issue · comments

To Reproduce
Set mode to carbon, store data and update display
Then set mode to agile, and update display
Error occurs

Expected behaviour
The missing data should be handled gracefully, perhaps with a reminder to store data first

*Error

Traceback (most recent call last):
  File "/home/pi/pi-eco-indicator/./update_display.py", line 67, in <module>
    eco_indicator.update_inky(config, data_rows, args.demo)
  File "/home/pi/pi-eco-indicator/eco_indicator.py", line 261, in update_inky
    high_slots_start_idx = high_slots_list.index(max(high_slots_list))
ValueError: max() arg is an empty sequence