Skip to content

Commit e4254c3

Browse files
author
Nick Shorter
committed
Merge branch 'dev' into main
2 parents 5364b61 + 243bded commit e4254c3

File tree

5 files changed

+27
-21
lines changed

5 files changed

+27
-21
lines changed

install.sh

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@ then
66
echo "Are you root?"
77
exit 2
88
fi
9-
apt update && apt upgrade -y
10-
apt install -y fonts-noto-mono
9+
apt update && apt upgrade -y && apt install -y fonts-noto-mono
10+
if [ 0 == $(echo $?) ]
11+
then
12+
echo "Error Occured While installing and updatings fonts"
13+
exit 1
14+
fi
1115

1216
mv -v $SOURCE_DIR/fonts/* /usr/share/fonts/
1317
mv -v $SOURCE_DIR/ohmyoled /usr/local/bin/
14-
if [[ -f /usr/lib/systemd/system/ohmyoled.service ]]
18+
if [ -f /usr/lib/systemd/system/ohmyoled.service ]
19+
then
1520
echo "ohmyoled service exists"
1621
else
17-
echo "Creating Systemd File"
22+
echo "Creating Systemd File for ohmyoled"
1823
cat <<EOF >> /usr/lib/systemd/system/ohmyoled.service
1924
[Unit]
2025
Description=OhMyOLED Service
@@ -27,21 +32,21 @@ WorkingDirectory=/usr/local/bin/
2732
[Install]
2833
WantedBy=multi-user.target
2934
EOF
30-
fi
31-
32-
if
35+
fi
36+
3337
ln -s /usr/lib/systemd/system/ohmyoled.service /etc/systemd/system/multi-user.target.wants/
3438
systemctl daemon-reload
3539

36-
mkdir -p /etc/ohmyoled/
37-
if [[ -f /etc/ohmyoled/ecIcons_utf8.csv ]] then
38-
echo "Icons File already Exists"
39-
else
40-
mv -v $SOURCE_DIR/ecIcons_utf8.csv /etc/ohmyoled/
41-
fi
40+
mkdir -p /etc/ohmyoled/ && mkdir -p /var/log/ohmyoled/
41+
if [ 0 == $(echo $?) ]
42+
then
43+
echo "Error Occured creating ohmyoled dirs"
44+
exit 1
45+
fi
4246

4347
echo "Created OhMyOled Config file to /etc/ohmyoled"
44-
if [[ -f /etc/ohmyoled/ohmyoled.conf ]] then
48+
if [ -f /etc/ohmyoled/ohmyoled.conf ]
49+
then
4550
echo "/etc/ohmyoled/ohmyoled.conf already exists"
4651
else
4752
mv -r $SOURCE_DIR/ohmyoled.conf /etc/ohmyoled/

lib/binary_build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
VERSION="1.2.0"
2+
VERSION="1.3.0"
33

44
# Can't put full folders
55
echo "Building the binary"

main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ async def main_run(self, loop):
146146
matrix_finish_time = time.perf_counter()
147147
logger.info(f"{matrix} rendered for {matrix_finish_time - matrix_start_time:0.4f}s")
148148
except Exception as E:
149-
logger.error(E)
150-
traceback.print_exc()
151-
loop.stop()
149+
logger.error(E)
150+
traceback.print_exc()
151+
loop.stop()
152152

153153
if __name__ == "__main__":
154154
parser = argparse.ArgumentParser(description="Run an OhMyOled Matix")

matrix/sport/sportmatrix.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def build_finished_game_image(self, nextgame):
8181
def check_offseason(self, api) -> bool:
8282
try:
8383
start_time, end_time = api.schedule.positions[0].timestamp, api.schedule.positions[-1].timestamp
84+
# Have to check for play offs
8485
if start_time <= datetime.now() <= end_time:
8586
return True
8687
except Exception:
@@ -168,7 +169,7 @@ def build_standings_image(self, api, xpos) -> Tuple[int, int]:
168169
async def render(self, api, loop):
169170
try:
170171
if not api:
171-
raise Exception("Error Occurrred inside of the sport matrix")
172+
raise Exception("Error Ocurred inside of the sport matrix")
172173
self.clear()
173174
self.reload_image()
174175
if self.check_offseason(api):
@@ -192,7 +193,7 @@ async def render(self, api, loop):
192193
time.sleep(3) if xpos == 1 else time.sleep(.001)
193194
else:
194195
font = ImageFont.truetype("/usr/share/fonts/fonts/04b24.otf", 14)
195-
self.draw_multiline_text((0, 0), "Baseball\nOffseason", font=font)
196+
self.draw_multiline_text((0, 0), f"{api.sport.name}\nOffseason", font=font)
196197
await self.render_image()
197198
time.sleep(30)
198199

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="ohmyoled",
5-
version="1.2.0",
5+
version="1.3.0",
66
python_requires='>=3.8.9',
77
packages=find_packages(),
88
description="64x32 Oled Matrix Display",

0 commit comments

Comments
 (0)