22import json
33import board
44import displayio
5- from adafruit_display_text .text_area import TextArea
5+ from adafruit_display_text .label import Label
66from adafruit_bitmap_font import bitmap_font
77
88cwd = ("/" + __file__ ).rsplit ('/' , 1 )[0 ] # the current working directory (where this file is)
@@ -37,27 +37,27 @@ def __init__(self, root_group, *, am_pm=True, celsius=True):
3737 self .large_font .load_glyphs (('°' ,)) # a non-ascii character we need for sure
3838 self .city_text = None
3939
40- self .time_text = TextArea (self .medium_font , width = 8 )
40+ self .time_text = Label (self .medium_font , max_glyphs = 8 )
4141 self .time_text .x = 200
42- self .time_text .y = 0
42+ self .time_text .y = 12
4343 self .time_text .color = 0xFFFFFF
4444 self ._text_group .append (self .time_text )
4545
46- self .temp_text = TextArea (self .large_font , width = 6 )
46+ self .temp_text = Label (self .large_font , max_glyphs = 6 )
4747 self .temp_text .x = 200
48- self .temp_text .y = 155
48+ self .temp_text .y = 195
4949 self .temp_text .color = 0xFFFFFF
5050 self ._text_group .append (self .temp_text )
5151
52- self .main_text = TextArea (self .large_font , width = 20 )
52+ self .main_text = Label (self .large_font , max_glyphs = 20 )
5353 self .main_text .x = 10
54- self .main_text .y = 155
54+ self .main_text .y = 195
5555 self .main_text .color = 0xFFFFFF
5656 self ._text_group .append (self .main_text )
5757
58- self .description_text = TextArea (self .small_font , width = 60 )
58+ self .description_text = Label (self .small_font , max_glyphs = 60 )
5959 self .description_text .x = 10
60- self .description_text .y = 205
60+ self .description_text .y = 225
6161 self .description_text .color = 0xFFFFFF
6262 self ._text_group .append (self .description_text )
6363
@@ -71,9 +71,9 @@ def display_weather(self, weather):
7171 city_name = weather ['name' ] + ", " + weather ['sys' ]['country' ]
7272 print (city_name )
7373 if not self .city_text :
74- self .city_text = TextArea (self .medium_font , text = city_name )
74+ self .city_text = Label (self .medium_font , text = city_name )
7575 self .city_text .x = 10
76- self .city_text .y = 0
76+ self .city_text .y = 12
7777 self .city_text .color = 0xFFFFFF
7878 self ._text_group .append (self .city_text )
7979
0 commit comments