fix(cli/db): remove obsolete db subcommand
This commit is contained in:
@ -15,8 +15,6 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var logs bool
|
||||
|
||||
var readTemperatureCmd = &cobra.Command{
|
||||
Use: "read",
|
||||
Short: "Reading temperature values from different or specified sensors by arguments",
|
||||
@ -38,7 +36,7 @@ var readTemperatureCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
if len(sensors) == 0 {
|
||||
return
|
||||
log.Fatalln("No sensors found, specified or configured")
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
@ -47,12 +45,20 @@ var readTemperatureCmd = &cobra.Command{
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
storage.Round(measuredValues, round)
|
||||
|
||||
measuredValues = types.SelectMeasuredValues(types.MeasuredValueTypeTemperature, measuredValues)
|
||||
|
||||
// print temperatures on stdout
|
||||
cli.PrintMeasuredValues(measuredValues, cnf, os.Stdout)
|
||||
|
||||
// Save the new measured values, if desired
|
||||
if logs {
|
||||
|
||||
if compression {
|
||||
measuredValues = storage.Compression(measuredValues)
|
||||
}
|
||||
|
||||
storageEndpoint, err := cnf.GetStorageEndpointURL()
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
var (
|
||||
compression bool
|
||||
configFile *string
|
||||
logs bool
|
||||
round float64
|
||||
|
||||
version *semver.Version
|
||||
@ -21,7 +22,7 @@ var temperatureCmd = &cobra.Command{
|
||||
Example: fmt.Sprintf("flucky temperature read\nflucky temperature read outdoor"),
|
||||
}
|
||||
|
||||
// Execute a
|
||||
// InitCmd initialize the subcommand
|
||||
func InitCmd(cmd *cobra.Command, cnfFile *string, sversion *semver.Version) {
|
||||
configFile = cnfFile
|
||||
version = sversion
|
||||
|
Reference in New Issue
Block a user