fix: temperature, sensor

changes:
- sensor temperature add
- sensor temperature list
- sensor temperature rm
- temperature get
- temperature log
- temperature push
This commit is contained in:
2018-11-20 22:55:06 +01:00
parent dd7ea3156e
commit 6d9368e86c
25 changed files with 850 additions and 48 deletions

View File

@ -22,7 +22,6 @@ func Create(configDir string, force bool) error {
}
// If no config file exists, create a new one on the location
if !force {
if _, err := os.Stat(configPath); !os.IsNotExist(err) {
return fmt.Errorf("%v already exists. Use -f to overwrite", configPath)
@ -54,7 +53,7 @@ func Read(configDir string) (*types.Config, error) {
var config types.Config
// If no config file exists, create a new one on the location
// If no config file exists, return an error
if _, err := os.Stat(configPath); os.IsNotExist(err) {
return nil, fmt.Errorf("Can not find config %v: %v", configPath, err)
}
@ -78,7 +77,7 @@ func Write(config *types.Config, configDir string) error {
configPath := filepath.Join(configDir, configFilename)
// If no config file exists, create a new one on the location
// If no config file exists, return an error
if _, err := os.Stat(configPath); os.IsNotExist(err) {
return fmt.Errorf("Can not find config %v: %v", configPath, err)
}