v.0.4.8 weather-info improvement
This commit is contained in:
@@ -30,18 +30,19 @@ def weather_check(display: NeoPixel_64x64, test_mode: bool = False):
|
||||
display.write_text(f'{str(w_resp.location.name)}', 0, ypos, color=colors.RAINBOW[0])
|
||||
ypos += display.font_height + 1
|
||||
# display.set_font(fonts.font_8x8)
|
||||
display.set_font(fonts.font_5x7)
|
||||
display.write_text(f'{str(w_resp.current.temp_c)}°C', 0, ypos, color=colors.RAINBOW[1])
|
||||
ypos += display.font_height + 1
|
||||
display.set_font(fonts.font_5x7)
|
||||
display.write_text(f'{str(w_resp.current.condition.text)}°C', 0, ypos, color=colors.RAINBOW[2])
|
||||
ypos += display.font_height + 1
|
||||
display.write_text(f'upd:{str(w_resp.current.last_updated)[-5:]}', 0, ypos, color=colors.RAINBOW[3])
|
||||
ypos += display.font_height + 1
|
||||
display.write_text(f'cur:{str(w_resp.location.localtime)[-5:]}', 0, ypos, color=colors.RAINBOW[4])
|
||||
|
||||
ypos += 3 * (display.font_height + 1)
|
||||
# unten rechts in die Ecke
|
||||
ypos = display.MATRIX_HEIGHT - display.font_height - 1
|
||||
|
||||
display.write_text('done.', 38, ypos, color=colors.WHITE)
|
||||
display.write_text('done.', 38, ypos, color=colors.NEON_GREEN)
|
||||
|
||||
except OSError as e:
|
||||
print(f'Error: connection closed - {e}')
|
||||
|
||||
Reference in New Issue
Block a user