Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
aceisace committed Sep 8, 2024
2 parents 9a75417 + 0052000 commit b7b9513
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-on-rpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/update-os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion inkycal/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ def __init__(self, settings_path: str or None = None, render: bool = True, use_p
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%!")
Expand Down
4 changes: 2 additions & 2 deletions inkycal/modules/inkycal_feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def generate_image(self):
# 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
Expand All @@ -129,7 +129,7 @@ def generate_image(self):
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)
Expand Down
3 changes: 1 addition & 2 deletions inkycal/modules/inkycal_webshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
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__)

Expand Down Expand Up @@ -89,7 +88,7 @@ def generate_image(self):
"""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}")
Expand Down

0 comments on commit b7b9513

Please sign in to comment.