Skip to content

Commit

Permalink
initial working
Browse files Browse the repository at this point in the history
  • Loading branch information
coinish committed Dec 29, 2023
1 parent 040e156 commit 14854be
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions weatherDisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ def main(forecast_elements,
except:
#go_to_screen= True# ...get screen size?
w, h, ink_black, ink_color= setup_screen()
#print (w,h)

img, msg = setup_canvas(w, h, forecast_elements["forecast_background"], bg_file, bg_map, zoom, lon, lat)
if verbose:
Expand Down Expand Up @@ -939,7 +940,8 @@ def main(forecast_elements,
tcolor= 0
if p:
#rain_indicator
draw.rectangle((x0, y1- 16- 1, x1- 1, y1- 16- 3), fill= (0, 0, 0, p))
#draw.rectangle((x0, y1- 16- 1, x1- 1, y1- 16- 3), fill= (0, 0, 0, p))
draw.rectangle((x0, y1- 16- 3, x1- 1, y1- 16- 1), fill= (0, 0, 0, p))
#rain bars
draw.rectangle((x0, clamp(y0, y1- (forecast_elements["precipitationRate"][i]/ 2* (y1- y0)), y1- 16), x1- 1, y1- 16), fill= (0, 0, 0, pcolor), outline= (0, 0, 0, 255))

Expand All @@ -957,8 +959,9 @@ def main(forecast_elements,
uv= int(255* .075)
else:
uv= (forecast_elements["uvIndex"][i] > 3)* 255
draw.rectangle((x0, y1, x1- 1, y1- 16), fill= (255, 255, 255, 255), outline= (0, 0, 0, 255))
draw.rectangle((x0, y1, x1- 1, y1- 16), fill= (255, 255, 0, uv), outline= (0, 0, 0, 255))
#print (x0, y1, x1- 1, y1- 16)
draw.rectangle((x0, y1-16, x1- 1, y1), fill= (255, 255, 255, 255), outline= (0, 0, 0, 255))
draw.rectangle((x0, y1-16, x1- 1, y1), fill= (255, 255, 0, uv), outline= (0, 0, 0, 255))

draw.text((x0+ 2, y0- 16+ y1), hour, fill= (0, 0, 0, 255), font= font, align= 'center') #added a plus one to look better lined up

Expand Down

0 comments on commit 14854be

Please sign in to comment.