Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ty-porter committed Feb 23, 2024
2 parents 087811d + c5bf3cb commit 8e34de6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions data/weather.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import time
import os, time

import pyowm

Expand Down Expand Up @@ -102,7 +102,7 @@ def wind_string(self):
return "{} {}".format(self.wind_speed_string(), self.wind_dir_string())

def icon_filename(self):
return "assets/weather/{}.png".format(self.icon_name)
return os.path.abspath("./assets/weather/{}.png".format(self.icon_name))

def __should_update(self):
endtime = time.time()
Expand Down
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def main(matrix, config_base):
debug.log("Using rgbmatrix version %s", __version__)

# Draw startup screen
logo = "assets/mlb-w" + str(matrix.width) + "h" + str(matrix.height) + ".png"
logo_path = os.path.abspath("./assets/mlb-w" + str(matrix.width) + "h" + str(matrix.height) + ".png")

# MLB image disabled when using renderer, for now.
# see: https://github.com/ty-porter/RGBMatrixEmulator/issues/9#issuecomment-922869679
if os.path.exists(logo) and driver.is_hardware() and PIL_LOADED:
logo = Image.open(logo)
if os.path.exists(logo_path) and driver.is_hardware() and PIL_LOADED:
logo = Image.open(logo_path)
matrix.SetImage(logo.convert("RGB"))
logo.close()

Expand Down
2 changes: 1 addition & 1 deletion renderers/offday.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __render_weather_icon(canvas, layout, colors, weather_icon):

if resize:
weather_icon = weather_icon.resize(
(weather_icon.width * resize, weather_icon.height * resize), PIL.Image.NEAREST
(weather_icon.width * resize, weather_icon.height * resize), Image.NEAREST
)
for x in range(weather_icon.width):
for y in range(weather_icon.height):
Expand Down

0 comments on commit 8e34de6

Please sign in to comment.