fix: renamed packages
This commit is contained in:
		@@ -3,12 +3,26 @@ package sensor
 | 
			
		||||
import (
 | 
			
		||||
	"os"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
 | 
			
		||||
	"git.cryptic.systems/fh-trier/go-flucky/pkg/types"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func sensorExists(wirePath, sensorID string) bool {
 | 
			
		||||
// 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
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user