Added comment to parseDSMRTimestamp.
Some checks failed
Build Docker image / build (push) Has been cancelled

This commit is contained in:
Pieter Hollander 2024-02-20 16:54:22 +01:00
parent a72897655b
commit dbb8319752
Signed by: pieter
SSH key fingerprint: SHA256:HbX+9cBXsop9SuvL+mELd29sK+7DehFfdVweFVDtMSg

10
main.go
View file

@ -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