Skip to content

Commit

Permalink
Merge branch 'release/v23.11.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
peted-davis committed Nov 5, 2023
2 parents f3a1a57 + dd16867 commit 1b42c53
Show file tree
Hide file tree
Showing 12 changed files with 324 additions and 300 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ running the 32 bit version of Raspberry Pi OS. It can be run on earlier models,
a Raspberry Pi 5, or the 64 bit version of Raspberry Pi OS, but no direct
support is provided for these environments. It is not compatible with Raspberry
Pi Zero or Zero W. Raspberry Pi 5 will become fully supported in the future.
While the console is compatiable with Raspberry Pi 3, the graphics hardware on
this model is ageing and performance of the console can be sluggish. It is
recommended to use a Pi 4 or above

For all models of Raspberry Pi, the console is compatible with Raspberry Pi OS
(Bookworm) or the legacy Raspberry Pi OS (Bullseye). The console is no longer
Expand Down
2 changes: 1 addition & 1 deletion kvlang/update.kv
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
## =============================================================================
## UPDATE NOTIFICATION POPUP
## =============================================================================
<updateNotification>:
<update_notification>:
size_hint: (None, 76/480)
pos_hint: {'x': app.CurrentConditions.ids.panel_six.x/app.window.width, 'y': 2/app.window.height}
width: app.CurrentConditions.ids.panel_six.size[0]
Expand Down
399 changes: 203 additions & 196 deletions lib/config.py

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions lib/derived_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ def SLP_trend(pressure, ob_time, device, api_data, config):
return error_output

# Define index of pressure in websocket packets
if str(device) == config['Station']['OutAirID']:
if str(device) in [config['Station']['OutAirID'], config['Station']['OutAirSN']]:
index_bucket_a = 1
elif str(device) == config['Station']['TempestID']:
elif str(device) in [config['Station']['TempestID'], config['Station']['TempestSN']]:
index_bucket_a = 6

# If REST API services are enabled, extract required observations from
Expand Down Expand Up @@ -319,9 +319,9 @@ def SLP_max(pressure, ob_time, max_pres, device, api_data, config):
time_now = datetime.now(pytz.utc).astimezone(Tz)

# Define index of temperature in websocket packets
if str(device) == config['Station']['OutAirID']:
if str(device) in [config['Station']['OutAirID'], config['Station']['OutAirSN']]:
index_bucket_a = 1
elif str(device) == config['Station']['TempestID']:
elif str(device) in [config['Station']['TempestID'], config['Station']['TempestSN']]:
index_bucket_a = 6

# If console is initialising and REST API services are enabled, download all
Expand Down Expand Up @@ -397,9 +397,9 @@ def SLP_min(pressure, ob_time, min_pres, device, api_data, config):
time_now = datetime.now(pytz.utc).astimezone(Tz)

# Define index of temperature in websocket packets
if str(device) == config['Station']['OutAirID']:
if str(device) in [config['Station']['OutAirID'], config['Station']['OutAirSN']]:
index_bucket_a = 1
elif str(device) == config['Station']['TempestID']:
elif str(device) in [config['Station']['TempestID'], config['Station']['TempestSN']]:
index_bucket_a = 6

# If console is initialising and REST API services are enabled, download all
Expand Down Expand Up @@ -467,9 +467,9 @@ def temp_diff(out_temp, ob_time, device, api_data, config):
return error_output

# Define index of temperature in websocket packets
if str(device) == config['Station']['OutAirID']:
if str(device) in [config['Station']['OutAirID'], config['Station']['OutAirSN']]:
index_bucket_a = 2
elif str(device) == config['Station']['TempestID']:
elif str(device) in [config['Station']['TempestID'], config['Station']['TempestSN']]:
index_bucket_a = 7

# If REST API services are enabled, extract required observations from
Expand Down Expand Up @@ -538,9 +538,9 @@ def temp_trend(out_temp, ob_time, device, api_data, config):
return error_output

# Define index of temperature in websocket packets
if str(device) == config['Station']['OutAirID']:
if str(device) in [config['Station']['OutAirID'], config['Station']['OutAirSN']]:
index_bucket_a = 2
elif str(device) == config['Station']['TempestID']:
elif str(device) in [config['Station']['TempestID'], config['Station']['TempestSN']]:
index_bucket_a = 7

# If REST API services are enabled, extract required observations from
Expand Down Expand Up @@ -616,10 +616,10 @@ def temp_max(temp, ob_time, max_temp, device, api_data, config):
time_now = datetime.now(pytz.utc).astimezone(Tz)

# Define index of temperature in websocket packets
if (str(device) == config['Station']['OutAirID']
or str(device) == config['Station']['InAirID']):
if (str(device) in [config['Station']['OutAirID'], config['Station']['OutAirSN']]
or str(device) in [config['Station']['InAirID'], config['Station']['InAirSN']]):
index_bucket_a = 2
elif str(device) == config['Station']['TempestID']:
elif str(device) in [config['Station']['TempestID'], config['Station']['TempestSN']]:
index_bucket_a = 7

# If console is initialising and REST API services are enabled, download all
Expand Down Expand Up @@ -692,10 +692,10 @@ def temp_min(temp, ob_time, min_temp, device, api_data, config):
time_now = datetime.now(pytz.utc).astimezone(Tz)

# Define index of temperature in websocket packets
if (str(device) == config['Station']['OutAirID']
or str(device) == config['Station']['InAirID']):
if (str(device) in [config['Station']['OutAirID'], config['Station']['OutAirSN']]
or str(device) in [config['Station']['InAirID'], config['Station']['InAirSN']]):
index_bucket_a = 2
elif str(device) == config['Station']['TempestID']:
elif str(device) in [config['Station']['TempestID'], config['Station']['TempestSN']]:
index_bucket_a = 7

# If console is initialising and REST API services are enabled, download all
Expand Down Expand Up @@ -787,9 +787,9 @@ def strike_frequency(ob_time, device, api_data, config):
return error_output

# Define index of total lightning strike counts in websocket packets
if str(device) == config['Station']['OutAirID']:
if str(device) in [config['Station']['OutAirID'], config['Station']['OutAirSN']]:
index_bucket_a = 4
elif str(device) == config['Station']['TempestID']:
elif str(device) in [config['Station']['TempestID'], config['Station']['TempestSN']]:
index_bucket_a = 15

# If REST API services are enabled, extract lightning strike count over the
Expand Down Expand Up @@ -891,10 +891,10 @@ def strike_count(count, strike_count, device, api_data, config):
time_now = datetime.now(pytz.utc).astimezone(Tz)

# Define index of total lightning strike counts in websocket packets
if str(device) == config['Station']['OutAirID']:
if str(device) in [config['Station']['OutAirID'], config['Station']['OutAirSN']]:
index_bucket_a = 4
index_bucket_e = 4
elif str(device) == config['Station']['TempestID']:
elif str(device) in [config['Station']['TempestID'], config['Station']['TempestSN']]:
index_bucket_a = 15
index_bucket_e = 24

Expand Down Expand Up @@ -1096,10 +1096,10 @@ def rain_accumulation(minute_rain, daily_rain, rain_accum, device, api_data, con
time_now = datetime.now(pytz.utc).astimezone(Tz)

# Define index of total daily rain accumulation in websocket packets
if str(device) == config['Station']['SkyID']:
if str(device) in [config['Station']['SkyID'], config['Station']['SkySN']]:
index_bucket_a = 3
index_bucket_e = 3
elif str(device) == config['Station']['TempestID']:
elif str(device) in [config['Station']['TempestID'], config['Station']['TempestSN']]:
index_bucket_a = 12
index_bucket_e = 28

Expand Down Expand Up @@ -1309,9 +1309,9 @@ def avg_wind_speed(wind_spd, avg_wind, device, api_data, config):
time_now = datetime.now(pytz.utc).astimezone(Tz)

# Define index of wind speed in websocket packets
if str(device) == config['Station']['SkyID']:
if str(device) in [config['Station']['SkyID'], config['Station']['SkySN']]:
index_bucket_a = 5
elif str(device) == config['Station']['TempestID']:
elif str(device) in [config['Station']['TempestID'], config['Station']['TempestSN']]:
index_bucket_a = 2

# If console is initialising and REST API services are enabled, download all
Expand Down Expand Up @@ -1377,9 +1377,9 @@ def max_wind_gust(wind_gust, max_gust, device, api_data, config):
time_now = datetime.now(pytz.utc).astimezone(Tz)

# Define index of wind speed in websocket packets
if str(device) == config['Station']['SkyID']:
if str(device) in [config['Station']['SkyID'], config['Station']['SkySN']]:
index_bucket_a = 6
elif str(device) == config['Station']['TempestID']:
elif str(device) in [config['Station']['TempestID'], config['Station']['TempestSN']]:
index_bucket_a = 3

# If console is initialising and REST API services are enabled, download all
Expand Down Expand Up @@ -1576,9 +1576,9 @@ def peak_sun_hours(radiation, peak_sun, device, api_data, config):
sunset = peak_sun[5]

# Define index of radiation in websocket packets
if str(device) == config['Station']['SkyID']:
if str(device) in [config['Station']['SkyID'], config['Station']['SkySN']]:
index_bucket_a = 10
elif str(device) == config['Station']['TempestID']:
elif str(device) in [config['Station']['TempestID'], config['Station']['TempestSN']]:
index_bucket_a = 11

# If console is initialising and REST API services are enabled, download all
Expand Down
18 changes: 10 additions & 8 deletions lib/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@ def fetch_forecast(self, *largs):
"""

# Fetch latest hourly and daily forecast
URL = 'https://swd.weatherflow.com/swd/rest/better_forecast?token={}&station_id={}'
URL = URL.format(self.app.config['Keys']['WeatherFlow'],
self.app.config['Station']['StationID'])
UrlRequest(URL,
on_success=self.success_forecast,
on_failure=self.fail_forecast,
on_error=self.fail_forecast,
ca_file=certifi.where())
if self.app.config['System']['rest_api'] == '1':
URL = 'https://swd.weatherflow.com/swd/rest/better_forecast?token={}&station_id={}'
URL = URL.format(self.app.config['Keys']['WeatherFlow'],
self.app.config['Station']['StationID'])
UrlRequest(URL,
on_success=self.success_forecast,
on_failure=self.fail_forecast,
on_error=self.fail_forecast,
timeout=int(self.app.config['System']['Timeout']),
ca_file=certifi.where())

def schedule_forecast(self, dt):

Expand Down
Loading

0 comments on commit 1b42c53

Please sign in to comment.