From 97353c83a6748fd30e5ea000c42ededd144d0923 Mon Sep 17 00:00:00 2001 From: Thomas Hooge Date: Sun, 20 Jul 2025 20:04:45 +0200 Subject: [PATCH] Added HDT, HDM and fixed formatting bug --- boatdata.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/boatdata.py b/boatdata.py index 3f1f30c..56aa6d2 100644 --- a/boatdata.py +++ b/boatdata.py @@ -168,10 +168,10 @@ class BoatValueGeo(BoatValue): minutes = (self.value - degrees) * 60 if self.geofmt == 'lat': direction = ('E' if self.value > 0 else 'W') - formatted = "{0}° {1:.{3}f}' {2}".format(degrees, minutes, direction, decpl) + formatted = "{0}° {1:.{3}f}' {2}".format(degrees, minutes, direction, self.decpl) elif self.geofmt == 'lon': direction = 'N' if self.value > 0 else 'S' - formatted = "{0}° {1:.{3}f}' {2}".format(degrees, minutes, direction, decpl) + formatted = "{0}° {1:.{3}f}' {2}".format(degrees, minutes, direction, self.decpl) else: formatted = str(self.placeholder) return formatted @@ -407,6 +407,8 @@ class BoatData(): self.gpst = BoatValueTime("GPST") self.sog = BoatValueSpeed("SOG", "kn") self.cog = BoatValueAngle("COG", "deg") + self.hdm = BoatValueAngle("HDM", "deg") + self.hdt = BoatValueAngle("HDT", "deg") self.xte = BoatValueDistance("XTE", "m") self.stw = BoatValueSpeed("STW", "kn") self.dbt = BoatValueDepth("DBT", "m") @@ -467,6 +469,8 @@ class BoatData(): 'AWS': self.aws, 'BTW': self.bearing, 'COG': self.cog, + 'HDM': self.hdm, + 'HDT': self.hdt, 'DBT': self.dbt, 'DBS': self.dbs, 'DTW': self.wpdist,