Organizes 11 projects for Cerbo GX/Venus OS into a single repository: - axiom-nmea: Raymarine LightHouse protocol decoder - dbus-generator-ramp: Generator current ramp controller - dbus-lightning: Blitzortung lightning monitor - dbus-meteoblue-forecast: Meteoblue weather forecast - dbus-no-foreign-land: noforeignland.com tracking - dbus-tides: Tide prediction from depth + harmonics - dbus-vrm-history: VRM cloud history proxy - dbus-windy-station: Windy.com weather upload - mfd-custom-app: MFD app deployment package - venus-html5-app: Custom Victron HTML5 app fork - watermaker: Watermaker PLC control UI Adds root README, .gitignore, project template, and per-project .gitignore files. Sensitive config files excluded via .gitignore with .example templates provided. Made-with: Cursor
83 lines
1.7 KiB
Python
83 lines
1.7 KiB
Python
"""
|
|
Temperature-related NMEA sentences.
|
|
|
|
MTW - Water Temperature
|
|
MTA - Air Temperature (proprietary extension)
|
|
"""
|
|
|
|
from typing import Optional
|
|
|
|
from ..sentence import NMEASentence
|
|
|
|
|
|
class MTWSentence(NMEASentence):
|
|
"""MTW - Water Temperature.
|
|
|
|
Format:
|
|
$IIMTW,T.T,C*CC
|
|
|
|
Fields:
|
|
1. Water temperature
|
|
2. Unit (C = Celsius)
|
|
|
|
Example:
|
|
$IIMTW,26.5,C*1D
|
|
"""
|
|
|
|
talker_id = "II"
|
|
sentence_type = "MTW"
|
|
|
|
def __init__(self, temp_c: Optional[float] = None):
|
|
"""Initialize MTW sentence.
|
|
|
|
Args:
|
|
temp_c: Water temperature in Celsius
|
|
"""
|
|
self.temp_c = temp_c
|
|
|
|
def format_fields(self) -> Optional[str]:
|
|
"""Format MTW fields."""
|
|
if self.temp_c is None:
|
|
return None
|
|
return f"{self.temp_c:.1f},C"
|
|
|
|
|
|
class MTASentence(NMEASentence):
|
|
"""MTA - Air Temperature.
|
|
|
|
Format:
|
|
$IIMTA,T.T,C*CC
|
|
|
|
Fields:
|
|
1. Air temperature
|
|
2. Unit (C = Celsius)
|
|
|
|
Example:
|
|
$IIMTA,24.8,C*0E
|
|
|
|
Note:
|
|
MTA is not a standard NMEA sentence but is commonly used
|
|
as a proprietary extension for air temperature, following
|
|
the same format as MTW (water temperature).
|
|
|
|
Some devices may use XDR (transducer measurement) for air temp:
|
|
$IIXDR,C,24.8,C,AirTemp*XX
|
|
"""
|
|
|
|
talker_id = "II"
|
|
sentence_type = "MTA"
|
|
|
|
def __init__(self, temp_c: Optional[float] = None):
|
|
"""Initialize MTA sentence.
|
|
|
|
Args:
|
|
temp_c: Air temperature in Celsius
|
|
"""
|
|
self.temp_c = temp_c
|
|
|
|
def format_fields(self) -> Optional[str]:
|
|
"""Format MTA fields."""
|
|
if self.temp_c is None:
|
|
return None
|
|
return f"{self.temp_c:.1f},C"
|