mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-12 05:42:59 +00:00
feat(weather): Adjust layout and use 4x6 font for details
Removed "time since update" text. Used 4x6.bdf font for pressure, humidity, and wind speed.
This commit is contained in:
@@ -232,12 +232,12 @@ class WeatherManager:
|
||||
fill=self.COLORS['text'])
|
||||
|
||||
# Draw "time ago" text below condition (using small font)
|
||||
time_since_update = int((time.time() - self.last_update) / 3600) # hours
|
||||
time_text = f"{time_since_update}h" # Even shorter text
|
||||
draw.text((icon_x + self.ICON_SIZE['large'] + 1, icon_y + 7), # Reduced from 8
|
||||
time_text,
|
||||
font=self.display_manager.small_font,
|
||||
fill=self.COLORS['dim']) # Using dimmer color
|
||||
# time_since_update = int((time.time() - self.last_update) / 3600) # hours
|
||||
# time_text = f"{time_since_update}h" # Even shorter text
|
||||
# draw.text((icon_x + self.ICON_SIZE['large'] + 1, icon_y + 7), # Reduced from 8
|
||||
# time_text,
|
||||
# font=self.display_manager.small_font,
|
||||
# fill=self.COLORS['dim']) # Using dimmer color
|
||||
|
||||
# Draw current temperature on the right (using small font instead of regular)
|
||||
temp = round(weather_data['main']['temp'])
|
||||
@@ -268,16 +268,16 @@ class WeatherManager:
|
||||
pressure_text = f"P:{pressure:.1f}in" # Even shorter format
|
||||
draw.text((2, y_start),
|
||||
pressure_text,
|
||||
font=self.display_manager.small_font,
|
||||
fill=self.COLORS['dim']) # Using dimmer color
|
||||
font=self.display_manager.extra_small_font,
|
||||
fill=self.COLORS['dim'])
|
||||
|
||||
# Humidity (shortened format)
|
||||
humidity = weather_data['main']['humidity']
|
||||
humidity_text = f"H:{humidity}%" # Even shorter format
|
||||
draw.text((2, y_start + spacing),
|
||||
humidity_text,
|
||||
font=self.display_manager.small_font,
|
||||
fill=self.COLORS['dim']) # Using dimmer color
|
||||
font=self.display_manager.extra_small_font,
|
||||
fill=self.COLORS['dim'])
|
||||
|
||||
# Wind speed and direction (shortened format)
|
||||
wind_speed = weather_data['wind']['speed']
|
||||
@@ -286,8 +286,8 @@ class WeatherManager:
|
||||
wind_text = f"W:{wind_speed:.0f}{wind_dir}" # Even shorter format, removed decimal
|
||||
draw.text((2, y_start + spacing * 2),
|
||||
wind_text,
|
||||
font=self.display_manager.small_font,
|
||||
fill=self.COLORS['dim']) # Using dimmer color
|
||||
font=self.display_manager.extra_small_font,
|
||||
fill=self.COLORS['dim'])
|
||||
|
||||
# Update the display
|
||||
self.display_manager.image = image
|
||||
|
||||
Reference in New Issue
Block a user