Use typed enums for cleaner parsing.

This commit is contained in:
Anna Rose Wiggins 2025-09-05 13:42:22 -04:00
parent 8d2b15a7c8
commit 553966ac87
5 changed files with 33 additions and 40 deletions

View file

@ -2,7 +2,6 @@ package main
import (
"context"
"strings"
"sync"
"git.annabunches.net/annabunches/joyful/internal/configparser"
@ -16,7 +15,7 @@ func initPhysicalDevices(conf *configparser.Config) map[string]*evdev.InputDevic
pDeviceMap := make(map[string]*evdev.InputDevice)
for _, devConfig := range conf.Devices {
if strings.ToLower(devConfig.Type) != configparser.DeviceTypePhysical {
if devConfig.Type != configparser.DeviceTypePhysical {
continue
}
@ -71,7 +70,7 @@ func initVirtualBuffers(config *configparser.Config) (map[string]*evdev.InputDev
vBuffersByDevice := make(map[*evdev.InputDevice]*virtualdevice.EventBuffer)
for _, devConfig := range config.Devices {
if strings.ToLower(devConfig.Type) != configparser.DeviceTypeVirtual {
if devConfig.Type != configparser.DeviceTypeVirtual {
continue
}