Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/windytron/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ category: weather
tags:
- utility
published: '2025-07-09T21:13:02Z'
updated: '2026-03-29T21:40:14Z'
updated: '2026-07-13T21:09:52Z'
9 changes: 8 additions & 1 deletion apps/windytron/windytron.star
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ station_lookup = {
"hookipa.json": "Ho'okipa",
"ukumehame.json": "Ukumehame",
"kihei.json": "Kihei",
"molokai_airport.json": "Moloka'i Airport",
"kalaupapa.json": "Kalaupapa",
"swell_city.json": "Swell City",
"stevenson_light.json": "Stevenson",
"viento.json": "Viento",
Expand Down Expand Up @@ -94,6 +96,11 @@ def main(config):
# Use custom label if set, otherwise use display name from lookup
label = custom_label if custom_label != "" else station_lookup.get(station, "Wind")

if wind_gust == 0:
wind_text = "%d %s" % (wind_avg, display_units)
else:
wind_text = "%dg%d %s" % (wind_avg, wind_gust, display_units)
Comment on lines +99 to +102

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

A gust speed should only be displayed if it is strictly greater than the average wind speed. If a station reports a gust speed that is less than or equal to the average wind speed (including 0), it should be omitted to avoid displaying nonsensical values like 15g12.

Suggested change
if wind_gust == 0:
wind_text = "%d %s" % (wind_avg, display_units)
else:
wind_text = "%dg%d %s" % (wind_avg, wind_gust, display_units)
if wind_gust <= wind_avg:
wind_text = "%d %s" % (wind_avg, display_units)
else:
wind_text = "%dg%d %s" % (wind_avg, wind_gust, display_units)


return render.Root(
child = render.Box(
render.Column(
Expand All @@ -106,7 +113,7 @@ def main(config):
color = label_color,
),
render.Text(
content = "%dg%d %s" % (wind_avg, wind_gust, display_units),
content = wind_text,
font = "6x13",
color = wind_color,
),
Expand Down