Skip to content

Commit

Permalink
show only one temp label in tomorrow's forecast
Browse files Browse the repository at this point in the history
  • Loading branch information
amit9838 committed May 27, 2024
1 parent 7aee005 commit ee99640
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/frontendForecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def page_stacks(self, page_name):
date_time = datetime.fromtimestamp(ts)
dt_label = date_time.strftime("%I:%M %p")
temp_max_text = hourly_data.temperature_2m.get("data")[idx+idx_offset]
temp_min_text = hourly_data.temperature_2m.get("data")[idx+idx_offset]
temp_min_text = 0
weather_code = hourly_data.weathercode.get("data")[idx+idx_offset]

if page_name == 'weekly':
Expand All @@ -131,9 +131,9 @@ def page_stacks(self, page_name):

# Add dt_label Label
label_box = Gtk.Box()
label_box.set_size_request(80, 20)
label_box.set_size_request(80, 68)
label_day_time = Gtk.Label(label=dt_label, halign=Gtk.Align.START)
label_day_time.set_css_classes(['text-4', 'bold-2'])
label_day_time.set_css_classes(['text-4', 'bold-2','light-2'])
label_box.append(label_day_time)
forecast_item_grid.attach(label_box, 0, 0, 1, 1)

Expand Down Expand Up @@ -161,9 +161,10 @@ def page_stacks(self, page_name):
temp_label_grid.attach(temp_max, 1, 0, 1, 1)

# Min temp label ======
temp_min = Gtk.Label(label=f" {temp_min_text:.0f}°", margin_top=5)
temp_min.set_css_classes(['light-4'])
temp_label_grid.attach(temp_min, 1, 1, 1, 1)
if page_name == 'weekly':
temp_min = Gtk.Label(label=f" {temp_min_text:.0f}°", margin_top=5)
temp_min.set_css_classes(['light-4'])
temp_label_grid.attach(temp_min, 1, 1, 1, 1)


# ============ get timestamp of upcomming 12:00 AM ====================
Expand Down

0 comments on commit ee99640

Please sign in to comment.