🎨 Fix different typing problems

This commit is contained in:
Rune Harlyk
2025-10-14 20:01:20 +02:00
parent 0aab42f0e9
commit 8970457353
11 changed files with 37 additions and 46 deletions
+2 -2
View File
@@ -18,7 +18,7 @@
servoAngles,
servoAnglesOut,
socket,
location,
apiLocation,
useFeatureFlags,
walkGait
} from '$lib/stores'
@@ -34,7 +34,7 @@
const features = useFeatureFlags()
onMount(async () => {
const ws = $location ? $location : window.location.host
const ws = $apiLocation ? $apiLocation : window.location.host
socket.init(`ws://${ws}/api/ws`)
addEventListeners()
+3 -3
View File
@@ -1,10 +1,10 @@
<script lang="ts">
import SettingsCard from '$lib/components/SettingsCard.svelte'
import { WiFi } from '$lib/components/icons'
import { location, socket } from '$lib/stores'
import { apiLocation, socket } from '$lib/stores'
const update = () => {
const ws = $location ? $location : window.location.host
const ws = $apiLocation ? $apiLocation : window.location.host
socket.init(`ws://${ws}/api/ws/events`)
}
</script>
@@ -19,7 +19,7 @@
<div class="flex">
<label class="label w-32" for="server">Address:</label>
<input class="input" bind:value={$location} />
<input class="input" bind:value={$apiLocation} />
</div>
<button class="btn btn-primary" onclick={update}>Update</button>
@@ -2,7 +2,19 @@
import { api } from '$lib/api'
import Spinner from '$lib/components/Spinner.svelte'
import type { CameraSettings } from '$lib/types/models'
let settings: CameraSettings = $state()
let settings: CameraSettings = $state({
brightness: 0,
contrast: 0,
framesize: 0,
vflip: false,
hmirror: false,
special_effect: 0,
quality: 0,
saturation: 0,
sharpness: 0,
denoise: 0,
wb_mode: 0
})
const getCameraSettings = async () => {
const result = await api.get<CameraSettings>('/api/camera/settings')
@@ -16,7 +16,7 @@
})
const handleSettings = (data: Record<string, unknown>) => {
settings = data
settings = data as PeripheralsConfiguration
}
const handleSave = () => {
+2 -2
View File
@@ -195,8 +195,8 @@
}
if ($features.bmp) {
updateChartData(tempChart, $imu.bmp_temp, 'Temperature')
updateChartData(altitudeChart, $imu.altitude, 'Altitude')
updateChartData(tempChart, $imu.bmp_temp)
updateChartData(altitudeChart, $imu.altitude)
}
}