func parseSensors(raw map[string]map[string]string) ([]Sensor, error) {
	sensors := make([]Sensor, 0, len(raw))
	for k, v := range raw {
		var s Sensor
		switch {
		case strings.HasPrefix(k, "curr"):
			s = new(CurrentSensor)
		case strings.HasPrefix(k, "intrusion"):
			s = new(IntrusionSensor)
		case strings.HasPrefix(k, "in"):
			s = new(VoltageSensor)
		case strings.HasPrefix(k, "fan"):
			s = new(FanSensor)
		case strings.HasPrefix(k, "power"):
			s = new(PowerSensor)
		case strings.HasPrefix(k, "temp"):
			s = new(TemperatureSensor)
		default:
			continue
		}
		s.setName(k)
		if err := s.parse(v); err != nil {
			return nil, err
		}
		sensors = append(sensors, s)
	}
	sort.Sort(byName(sensors))
	return sensors, nil
}
parseSensors parses all Sensors from an input raw data slice, produced
during a filesystem walk.
package lmsensors
import (
	"sort"
	"strings"
)
type Device struct {
	Name string
	Sensors []Sensor
}
type Sensor interface {
	parse(raw map[string]string) error
	name() string
	setName(name string)
}