fix: pass temp_unit from API to WeatherCard so F/C label matches converted values

This commit is contained in:
2026-03-28 13:21:30 -04:00
parent 164c55e845
commit 697d99cc4d
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -63,11 +63,13 @@ const loadingMessages = ref(false)
// Weather panel (left column) // Weather panel (left column)
const weatherData = ref<WeatherData[]>([]) const weatherData = ref<WeatherData[]>([])
const tempUnit = ref<string>('C')
async function loadWeather() { async function loadWeather() {
try { try {
const data = await apiGet<{ locations: WeatherData[] }>('/api/briefing/weather') const data = await apiGet<{ locations: WeatherData[]; temp_unit: string }>('/api/briefing/weather')
weatherData.value = data.locations ?? [] weatherData.value = data.locations ?? []
tempUnit.value = data.temp_unit ?? 'C'
} catch { /* silent */ } } catch { /* silent */ }
} }
@@ -296,6 +298,7 @@ onMounted(async () => {
v-for="loc in weatherData" v-for="loc in weatherData"
:key="(loc as WeatherData).location" :key="(loc as WeatherData).location"
:weather="loc" :weather="loc"
:temp-unit="tempUnit"
/> />
</template> </template>
<div v-else class="panel-empty">No weather configured</div> <div v-else class="panel-empty">No weather configured</div>
+1 -1
View File
@@ -143,7 +143,7 @@ async def get_weather():
card for row in rows card for row in rows
if (card := weather_svc.parse_weather_card_data(row, temp_unit)) is not None if (card := weather_svc.parse_weather_card_data(row, temp_unit)) is not None
] ]
return jsonify({"locations": cards}) return jsonify({"locations": cards, "temp_unit": temp_unit})
@briefing_bp.route("/weather/geocode", methods=["POST"]) @briefing_bp.route("/weather/geocode", methods=["POST"])