X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=weather_renderer.py;h=8da01ab73bae05e880c3e3e9e3ac32191608e899;hb=5ea88ab72e175e2d4f57ae8645ca6f825549a7a9;hp=4285fdefd5b646eb24f65a6ac24aba0febd35164;hpb=8dc3a81f3bc8eb9ac4871b64c6d471493d293316;p=kiosk.git diff --git a/weather_renderer.py b/weather_renderer.py index 4285fde..8da01ab 100644 --- a/weather_renderer.py +++ b/weather_renderer.py @@ -13,7 +13,7 @@ import file_writer import renderer import kiosk_secrets as secrets -logger = logging.getLogger(__file__) +logger = logging.getLogger(__name__) class weather_renderer(renderer.abstaining_renderer): @@ -86,7 +86,7 @@ class weather_renderer(renderer.abstaining_renderer): def fetch_weather(self) -> bool: if self.file_prefix == "stevens": text_location = "Stevens Pass, WA" - param = "lat=47.74&lon=-121.08" + param = "lat=47.7322&lon=-121.1025" elif self.file_prefix == "telma": text_location = "Telma, WA" param = "lat=47.84&lon=-120.81" @@ -265,10 +265,14 @@ function makePrecipChart(name, xValues, yValues) { aggregate_daily_precip = 0.0 for r, s in zip(rain[date], snow[date]): hourly_aggregate = r + s + + # The weather report is always way wrong about Stevens. + if self.file_prefix == "stevens": + hourly_aggregate *= 3.5 aggregate_daily_precip += hourly_aggregate precip[date].append(hourly_aggregate) logger.debug( - f"Aggregate precip on {date} was {aggregate_daily_precip} cm" + f"Aggregate precip on {date} was {aggregate_daily_precip} mm" ) if first_day: while len(precip[date]) < 8: @@ -326,9 +330,9 @@ function makePrecipChart(name, xValues, yValues) { """ ) - # Total aggregate_precip in inches - aggregate_daily_precip /= 2.54 - if aggregate_daily_precip > 0.025: + # Total aggregate_precip in inches (from mm) + aggregate_daily_precip /= 25.4 + if aggregate_daily_precip > 0.001: f.write( f"""