Compare commits

..

1 Commits

Author SHA1 Message Date
2e04b54193 Update module github.com/influxdata/influxdb-client-go/v2 to v2.12.3
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-03 09:19:05 +00:00
3 changed files with 0 additions and 42 deletions

View File

@ -12,8 +12,6 @@ RUN go get -d -v && \
FROM alpine
RUN apk add --no-cache tzdata
CMD ["linky2influx"]
COPY --from=gobuild /go/src/git.nemunai.re/linky2influx/linky2influx /usr/bin/linky2influx

View File

@ -1,38 +0,0 @@
package main
import (
"flag"
"fmt"
"os"
"strings"
)
func parseEnvironmentVariables() (err error) {
for _, line := range os.Environ() {
if strings.HasPrefix(line, "LINKY2INFLUX_") {
err := parseConfigLine(line)
if err != nil {
return fmt.Errorf("error in environment (%q): %w", line, err)
}
}
}
return
}
func parseConfigLine(line string) (err error) {
fields := strings.SplitN(line, "=", 2)
orig_key := strings.TrimSpace(fields[0])
value := strings.TrimSpace(fields[1])
if len(value) == 0 {
return
}
key := strings.TrimPrefix(orig_key, "LINKY2INFLUX_")
key = strings.Replace(key, "_", "-", -1)
key = strings.ToLower(key)
err = flag.Set(key, value)
return
}

View File

@ -180,8 +180,6 @@ type TICWriter interface {
}
func main() {
parseEnvironmentVariables()
var legacyMode = flag.Bool("legacy-mode", false, "Assume teleinformation in legacy mode")
var pushFrequency = flag.Bool("push-frequency", false, "Also fetch data about the grid frequency")
flag.Parse()