🎨 Renames topics

This commit is contained in:
Rune Harlyk
2025-09-01 18:44:42 +02:00
parent 527764b0b5
commit df087decdb
12 changed files with 142 additions and 136 deletions
@@ -1,6 +1,6 @@
<script lang="ts">
import { socket } from '$lib/stores'
import { Topics } from '$lib/types/models'
import { MessageTopic } from '$lib/types/models'
import { throttler as Throttler } from '$lib/utilities'
let { servoId = $bindable(0), pwm = $bindable(306) } = $props()
@@ -12,16 +12,16 @@
const throttler = new Throttler()
const activateServo = () => {
socket.sendEvent(Topics.servoState, { active: 1 })
socket.sendEvent(MessageTopic.servoState, { active: 1 })
}
const deactivateServo = () => {
socket.sendEvent(Topics.servoState, { active: 0 })
socket.sendEvent(MessageTopic.servoState, { active: 0 })
}
const updatePWM = () => {
throttler.throttle(() => {
socket.sendEvent(Topics.servoPWM, { servo_id: servoId, pwm })
socket.sendEvent(MessageTopic.servoPWM, { servo_id: servoId, pwm })
}, 10)
}