diff --git a/internal/agent/workers_linux.go b/internal/agent/workers_linux.go index f6de351d2..bab0cd8a0 100644 --- a/internal/agent/workers_linux.go +++ b/internal/agent/workers_linux.go @@ -6,6 +6,7 @@ package agent import ( "context" "log/slog" + "slices" "github.com/joshuar/go-hass-agent/internal/device" "github.com/joshuar/go-hass-agent/internal/hass/event" @@ -139,8 +140,9 @@ func setupOSWorkers(ctx context.Context) ([]Worker[sensor.Entity], []Worker[even // Get the type of device we are running on. chassis, _ := device.Chassis() //nolint:errcheck // error is same as any value other than wanted value. - // If running on a laptop, add laptop specific sensor workers. - if chassis == "laptop" { + laptops := []string{"Portable", "Laptop", "Notebook"} + // If running on a laptop chassis, add laptop specific sensor workers. + if slices.Contains(laptops, chassis) { for _, workerInit := range sensorLaptopWorkersInitFuncs { worker, err := workerInit(ctx) if err != nil { diff --git a/internal/device/device.go b/internal/device/device.go index 20020aa1a..9a6966513 100644 --- a/internal/device/device.go +++ b/internal/device/device.go @@ -109,7 +109,7 @@ func Chassis() (string, error) { return "", fmt.Errorf("could not determine chassis type: %w", err) } - return chassisInfo.Type, nil + return chassisInfo.TypeDescription, nil } // getHostname retrieves the hostname of the device running the agent, or