fix: temperature, sensor
changes: - sensor temperature add - sensor temperature list - sensor temperature rm - temperature get - temperature log - temperature push
This commit is contained in:
		
							
								
								
									
										14
									
								
								pkg/sensor/sensor.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								pkg/sensor/sensor.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
package sensor
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"os"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func sensorExists(wirePath, sensorID string) bool {
 | 
			
		||||
	sensorPath := filepath.Join(wirePath, sensorID)
 | 
			
		||||
	if _, err := os.Stat(sensorPath); os.IsNotExist(err) {
 | 
			
		||||
		return false
 | 
			
		||||
	}
 | 
			
		||||
	return true
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user