Fixes
This commit is contained in:
@@ -11,7 +11,7 @@ function toggleDark() { dark.value = !dark.value }
|
|||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
:root {
|
:root {
|
||||||
--bg: #ffffff;
|
--bg: #ffffff;
|
||||||
--surface: #f8fafc;
|
--surface: #d0dae1;
|
||||||
--border: #e2e8f0;
|
--border: #e2e8f0;
|
||||||
--text: #0f172a;
|
--text: #0f172a;
|
||||||
--text-muted: #64748b;
|
--text-muted: #64748b;
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ function dir(deg: number) {
|
|||||||
<div class="forecast-wrap">
|
<div class="forecast-wrap">
|
||||||
<div v-if="days?.length" class="strip">
|
<div v-if="days?.length" class="strip">
|
||||||
<div v-for="d in days" class="day">
|
<div v-for="d in days" class="day">
|
||||||
<div class="day-name">{{ formatDate('ddd, MMM D', new Date(d.time + 'T00:00:00')) }}</div>
|
<div class="day-name">{{ formatDate('ddd, MMM D', d.time) }}</div>
|
||||||
<img :src="BASE + d.icon" class="day-icon" :alt="(d.label?.toString() || '')" />
|
<img :src="BASE + d.icon" class="day-icon" :alt="(d.label?.toString() || '')" />
|
||||||
<div class="day-label">{{ d.label }}</div>
|
<div class="day-label">{{ d.label }}</div>
|
||||||
<div class="day-temps">
|
<div class="day-temps">
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ def cfg():
|
|||||||
'SLUSH_TEMP_THRESHOLD': float( os.getenv('SLUSH_TEMP_THRESHOLD', '0.0')),
|
'SLUSH_TEMP_THRESHOLD': float( os.getenv('SLUSH_TEMP_THRESHOLD', '0.0')),
|
||||||
'SNOW_STRENGTH_MIN': int( os.getenv('SNOW_STRENGTH_MIN', '700')),
|
'SNOW_STRENGTH_MIN': int( os.getenv('SNOW_STRENGTH_MIN', '700')),
|
||||||
'SEISMIC_NOISE_FLOOR': float( os.getenv('SEISMIC_NOISE_FLOOR', '0.02')),
|
'SEISMIC_NOISE_FLOOR': float( os.getenv('SEISMIC_NOISE_FLOOR', '0.02')),
|
||||||
'TEMP_CALIBRATION': float( os.getenv('TEMP_CALIBRATION', '-7.5')),
|
'TEMP_CALIBRATION': float( os.getenv('TEMP_CALIBRATION', '0.0')),
|
||||||
'CLOUD_BUCKET_SIZE': int( os.getenv('CLOUD_BUCKET_SIZE', '5')),
|
'CLOUD_BUCKET_SIZE': int( os.getenv('CLOUD_BUCKET_SIZE', '5')),
|
||||||
'CLOUD_HISTORY': int( os.getenv('CLOUD_HISTORY', '20')),
|
'CLOUD_HISTORY': int( os.getenv('CLOUD_HISTORY', '20')),
|
||||||
'CLOUD_BASELINE_PCT': float( os.getenv('CLOUD_BASELINE_PCT', '0.9')),
|
'CLOUD_BASELINE_PCT': float( os.getenv('CLOUD_BASELINE_PCT', '0.9')),
|
||||||
|
|||||||
@@ -198,20 +198,22 @@ export async function get24HourForecast(currentSensors) {
|
|||||||
|
|
||||||
function summarise(slots) {
|
function summarise(slots) {
|
||||||
if (!slots.length) return null
|
if (!slots.length) return null
|
||||||
const temps = slots.map(s => s.temperature).filter(Number.isFinite)
|
const daytimeSlots = slots.filter(s => s.daytime)
|
||||||
const precips = slots.map(s => s.precipitation_chance).filter(Number.isFinite)
|
const source = daytimeSlots.length ? daytimeSlots : slots // fallback if no daytime
|
||||||
const winds = slots.map(s => s.wind_speed).filter(Number.isFinite)
|
|
||||||
const gusts = slots.map(s => s.wind_gusts).filter(Number.isFinite)
|
const temps = source.map(s => s.temperature).filter(Number.isFinite)
|
||||||
const uvs = slots.map(s => s.uv_index).filter(Number.isFinite)
|
const precips = source.map(s => s.precipitation_chance).filter(Number.isFinite)
|
||||||
const solar = slots.map(s => s.solar_wm2).filter(Number.isFinite)
|
const winds = source.map(s => s.wind_speed).filter(Number.isFinite)
|
||||||
|
const gusts = source.map(s => s.wind_gusts).filter(Number.isFinite)
|
||||||
|
const uvs = source.map(s => s.uv_index).filter(Number.isFinite)
|
||||||
|
const solar = source.map(s => s.solar_wm2).filter(Number.isFinite)
|
||||||
|
|
||||||
// Most frequent label/code by occurrence
|
|
||||||
const labelCount = {}
|
const labelCount = {}
|
||||||
for (const s of slots) {
|
for (const s of source) {
|
||||||
if(s.daytime) labelCount[s.label] = (labelCount[s.label] || 0) + 1
|
labelCount[s.label] = (labelCount[s.label] || 0) + 1
|
||||||
}
|
}
|
||||||
const label = Object.entries(labelCount).sort((a, b) => b[1] - a[1])[0][0]
|
const label = Object.entries(labelCount).sort((a, b) => b[1] - a[1])[0][0]
|
||||||
const dominant = slots.find(s => s.label === label)
|
const dominant = source.find(s => s.label === label)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
time: slots[0].time,
|
time: slots[0].time,
|
||||||
|
|||||||
Reference in New Issue
Block a user