@@ -36,14 +36,14 @@ def get_temp_color(self, temp: int) -> Tuple[int, int, int]:
36
36
37
37
def render_temp (self , api ) -> None :
38
38
font : ImageFont = ImageFont .truetype ("/usr/share/fonts/retro_computer.ttf" , 7 )
39
- self .draw_text ((0 , 10 ), "T:" , font = font )
40
- self .draw_text ((10 , 10 ), f"{ str (int (api .get_temp ))} F" , font = font , fill = self .get_temp_color (int (api .get_temp )))
41
- self .draw_text ((30 , 10 ), "R:" , font = font )
42
- self .draw_text ((40 , 10 ), f"{ str (int (api .get_feels_like ))} F" , font = font , fill = self .get_temp_color (int (api .get_temp )))
43
- self .draw_text ((1 ,20 ), f"H:" , font = font )
44
- self .draw_text ((10 , 20 ), f"{ str (int (api .get_max_temp ))} F" , font = font , fill = self .get_temp_color (int (api .get_temp )))
45
- self .draw_text ((30 , 20 ), f"L:" , font = font )
46
- self .draw_text ((40 , 20 ), f"{ str (int (api .get_min_temp ))} F" , font = font , fill = self .get_temp_color (int (api .get_temp )))
39
+ self .draw_text ((0 , 8 ), "T:" , font = font )
40
+ self .draw_text ((10 , 8 ), f"{ str (int (api .get_temp ))} F" , font = font , fill = self .get_temp_color (int (api .get_temp )))
41
+ self .draw_text ((30 , 8 ), "R:" , font = font )
42
+ self .draw_text ((40 , 8 ), f"{ str (int (api .get_feels_like ))} F" , font = font , fill = self .get_temp_color (int (api .get_temp )))
43
+ self .draw_text ((1 , 18 ), f"H:" , font = font )
44
+ self .draw_text ((10 , 18 ), f"{ str (int (api .get_max_temp ))} F" , font = font , fill = self .get_temp_color (int (api .get_temp )))
45
+ self .draw_text ((30 , 18 ), f"L:" , font = font )
46
+ self .draw_text ((40 , 18 ), f"{ str (int (api .get_min_temp ))} F" , font = font , fill = self .get_temp_color (int (api .get_temp )))
47
47
48
48
def render_icon (self , api : Weather ) -> None :
49
49
font : ImageFont = ImageFont .truetype ("/usr/share/fonts/weathericons.ttf" , 9 )
@@ -112,19 +112,31 @@ def render_time(self, api: Weather) -> None:
112
112
self .draw_text ((7 , 23 ), sunrise , font = font )
113
113
self .draw_text ((35 , 18 ), "\uf044 " , font = ImageFont .truetype ("/usr/share/fonts/weathericons.ttf" , 11 ), fill = (255 , 145 , 0 ))
114
114
self .draw_text ((40 , 23 ), sunset , font = font )
115
-
115
+ def render_conditions (self , api : Weather , xpos : int ) -> None :
116
+ self .draw_text ((- xpos , 26 ), f"Conditions: { api .get_conditions } " , font = ImageFont .truetype ("/usr/share/fonts/04B_03B_.TTF" , 8 ), fill = (255 ,255 ,255 ))
116
117
async def render (self , api : Weather , loop ) -> None :
117
118
self .logger .info ("Rendering Weather Matrix" )
118
119
self .logger .debug ("Clearing Image" )
119
120
self .clear ()
120
121
self .logger .debug ("Reloading Image in matrix" )
122
+ xpos = 0
123
+ self .logger .info ("Loading Screen 1 of Matrix" )
124
+ while xpos < 100 :
125
+ self .reload_image ()
126
+ self .render_temp (api )
127
+ self .render_icon (api )
128
+ self .render_location (api )
129
+ self .render_conditions (api , xpos )
130
+ xpos += 1
131
+ await self .render_image ()
132
+ time .sleep (3 ) if xpos == 1 else time .sleep (.05 )
121
133
self .reload_image ()
122
134
self .render_temp (api )
123
135
self .render_icon (api )
124
136
self .render_location (api )
125
- self .logger . info ( "Loading Screen 1 of Matrix" )
137
+ self .render_conditions ( api , 0 )
126
138
await self .render_image ()
127
- time .sleep (30 )
139
+ time .sleep (25 )
128
140
self .clear ()
129
141
self .logger .debug ("Reloading Image in matrix" )
130
142
self .reload_image ()
0 commit comments