package sensor import ( "os" "path/filepath" "git.cryptic.systems/fh-trier/go-flucky/pkg/types" ) // Exists returns a boolean if the sensor exists func Exists(wirePath, sensorID string) bool { sensorPath := filepath.Join(wirePath, sensorID) if _, err := os.Stat(sensorPath); os.IsNotExist(err) { return false } return true } // IsRedundant returns a boolean if the sensorID is in the array func IsRedundant(sensorID string, sensors []*types.WireSensor) bool { for _, sensor := range sensors { if sensor.ID == sensorID { return true } } return false }