From dbb8319752200c87de96a58b24aba33b9cf1d485 Mon Sep 17 00:00:00 2001 From: Pieter Hollander Date: Tue, 20 Feb 2024 16:54:22 +0100 Subject: [PATCH] Added comment to parseDSMRTimestamp. --- main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.go b/main.go index e9d90bd..8ca41b3 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,4 @@ +// TODO: Make TimescaleDB optional. package main import ( @@ -245,6 +246,15 @@ func mqttMessageHandler(client mqtt.Client, msg mqtt.Message) { } } +// parseDSMRTimestamp parses the timestamp as emitted by the P1 meter +// (YYMMDDhhmmssX, where X is S or W for summer- or wintertime). +// +// More information: +// https://github.com/matthijskooijman/arduino-dsmr/blob/master/README.md +// https://srolija.medium.com/gos-summer-time-localization-issues-4c8ab702806b +// https://github.com/thomasvnl/P1DSMRReader-ESPHome +// https://pkg.go.dev/github.com/mijnverbruik/dsmr#Timestamp.Position +// https://pkg.go.dev/github.com/mijnverbruik/dsmr#Timestamp func parseDSMRTimestamp(t string) (time.Time, error) { // Extract values from timestamp string