diff --git a/.github/workflows/test-on-rpi.yml b/.github/workflows/test-on-rpi.yml index 5e3f014..1dffda5 100644 --- a/.github/workflows/test-on-rpi.yml +++ b/.github/workflows/test-on-rpi.yml @@ -41,6 +41,7 @@ jobs: echo $HOME whoami cd /home/inky + sudo apt update sudo apt-get update -y sudo apt-get install git zlib1g libjpeg-dev libatlas-base-dev rustc libopenjp2-7 python3-dev scons libssl-dev python3-venv python3-pip git libfreetype6-dev wkhtmltopdf libopenblas-dev -y echo $PWD && ls diff --git a/.github/workflows/update-os.yml b/.github/workflows/update-os.yml index 9641a76..f298e71 100644 --- a/.github/workflows/update-os.yml +++ b/.github/workflows/update-os.yml @@ -37,6 +37,7 @@ jobs: # get kernel info uname -srm cd /home/inky + sudo apt update sudo apt-get update -y # sudo apt-get dist-upgrade -y diff --git a/README.md b/README.md index af7203e..e84539a 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,7 @@ Run the following steps to install Inkycal. Do **not** use sudo for this, except ```bash # Raspberry Pi specific section start +sudo apt update sudo apt-get install git zlib1g libjpeg-dev libatlas-base-dev rustc libopenjp2-7 python-dev-is-python3 scons libssl-dev python3-venv python3-pip git libfreetype6-dev wkhtmltopdf libopenblas-dev git clone https://github.com/WiringPi/WiringPi cd WiringPi diff --git a/inkycal/main.py b/inkycal/main.py index cef0e11..6238082 100644 --- a/inkycal/main.py +++ b/inkycal/main.py @@ -163,7 +163,12 @@ class Inkycal: self.pisugar = PiSugar() self.battery_capacity = self.pisugar.get_battery() - logger.info(f"PiSugar battery capacity: {self.battery_capacity}%") + + if not self.battery_capacity: + logger.warning("[PISUGAR] Could not get battery capacity! Is the board off? Setting battery capacity to 0%") + self.battery_capacity = 100 + else: + logger.info(f"PiSugar battery capacity: {self.battery_capacity}%") if self.battery_capacity < 20: logger.warning("Battery capacity is below 20%!") diff --git a/inkycal/modules/inkycal_feeds.py b/inkycal/modules/inkycal_feeds.py index 38a6294..99f1854 100644 --- a/inkycal/modules/inkycal_feeds.py +++ b/inkycal/modules/inkycal_feeds.py @@ -114,7 +114,7 @@ class Feeds(inkycal_module): # if "description" in posts: if parsed_feeds: - parsed_feeds = [i.split("\n") for i in parsed_feeds][0] + parsed_feeds = [i.split("\n") for i in parsed_feeds] parsed_feeds = [i for i in parsed_feeds if i] # Shuffle the list to prevent showing the same content @@ -129,7 +129,7 @@ class Feeds(inkycal_module): filtered_feeds, counter = [], 0 for posts in parsed_feeds: - wrapped = text_wrap(posts, font=self.font, max_width=line_width) + wrapped = text_wrap(posts[0], font=self.font, max_width=line_width) counter += len(wrapped) if counter < max_lines: filtered_feeds.append(wrapped) diff --git a/inkycal/modules/inkycal_webshot.py b/inkycal/modules/inkycal_webshot.py index 5f72351..3655752 100644 --- a/inkycal/modules/inkycal_webshot.py +++ b/inkycal/modules/inkycal_webshot.py @@ -8,7 +8,6 @@ from htmlwebshot import WebShot from inkycal.custom import * from inkycal.modules.inky_image import Inkyimage as Images, image_to_palette from inkycal.modules.template import inkycal_module -from tests import Config logger = logging.getLogger(__name__) @@ -89,7 +88,7 @@ class Webshot(inkycal_module): """Generate image for this module""" # Create tmp path - tmpFolder = Config.TEMP_PATH + tmpFolder = "temp" if not os.path.exists(tmpFolder): print(f"Creating tmp directory {tmpFolder}")