Skip to content

Commit

Permalink
fix(linux): 🐛 display at least some name if no display name was set f…
Browse files Browse the repository at this point in the history
…or sensor
  • Loading branch information
joshuar committed Sep 2, 2024
1 parent 772fd56 commit 96bd6a2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/linux/sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,18 @@ type Sensor struct {
// by embedding linuxSensor in another struct and defining the needed function.

func (l *Sensor) Name() string {
if l.DisplayName == "" {
return "Unknown Sensor"
}

return l.DisplayName
}

func (l *Sensor) ID() string {
if l.DisplayName == "" {
return "unknown_sensor"
}

return strcase.ToSnake(l.DisplayName)
}

Expand Down

0 comments on commit 96bd6a2

Please sign in to comment.