Commit Graph
11 Commits
Author SHA1 Message Date
hemna f30f7640ac refactor: compose Position value object into GPSPacket
Replace the flat GPS fields on GPSPacket and its subclasses with a
composed Position value object (has-a instead of is-a), collapsing the
Packet -> GPSPacket -> {Beacon, MicE, Telemetry, Object, Weather}
data spine.  Position owns the coordinates, symbol, movement/PHG data
and the conversion/formatting logic (zulu time, DDM, human_info).

- GPSPacket holds position: Optional[Position]; subclass defaults
  preserved via _position_default() (ObjectPacket 'r', WeatherPacket '_')
- to_dict()/from_dict() flatten/unflatten so the on-disk JSON format
  is unchanged; verified via objectstore save/load round-trip
- GPSPacket inherits DataClassJsonMixin directly because the
  @dataclass_json decorator overwrites to_dict()/from_dict() and would
  clobber the flattening overrides
- constructor is breaking: position=Position(...) instead of
  latitude=.../longitude=...; updated tx.py, log.py and all tests

Full test suite (775) passes; ruff format + lint clean.
2026-09-24 10:19:35 -04:00
hemna 1da92e52ef Added unit tests for packets.
Also did some code cleanup.
2026-01-05 17:00:03 -05:00
hemna 72d068c0b8 Changed to ruff
This patch changes to the ruff linter.  SO MUCH quicker.
Removed grey and mypy as well.
2024-12-20 22:00:54 -05:00
hemna f400c6004e Fix for filtering curse words
This patch adds a fix for filtering out curse words.
This adds a flag to the regex to ignore case!
2024-03-23 18:02:01 -04:00
hemna f53df24988 More packet cleanup and tests 2024-03-23 17:05:41 -04:00
hemna e386e91f6e Eliminated need for from_aprslib_dict
This patch eliminates the need for a custom
static method on each Packetclass to convert an aprslib
raw decoded dictionary -> correct Packet class.

This now uses the built in dataclasses_json from_dict()
mixin with an override for both the WeatherPacket and
the ThirdPartyPacket.

This patch also adds the TelemetryPacket and adds some
missing members to a few of the classes from test runs
decoding all packets from APRS-IS -> Packet classes.

Also adds some verification for packets in test_packets
2024-03-20 21:46:43 -04:00
hemna 386d2bea62 Fix for micE packet decoding with mbits 2024-03-20 16:12:18 -04:00
hemna 1477e61b0f Refactored packets
this patch removes the need for dacite2 package for creating
packet objects from the aprslib decoded packet dictionary.

moved the factory method from the base Packet object
to the core module.
2024-03-20 15:41:25 -04:00
hemna ce3b29f990 Added rain formatting unit tests to WeatherPacket 2022-12-22 12:04:17 -05:00
hemna 6030cb394b More messaging -> packets cleanup
Fixed the unit tests and the notify plugin
2022-12-16 15:58:03 -05:00
hemna 67a441d443 Updated plugins and plugin interfaces for Packet
This patch updates unit tests as well as the Plugin filter()
interface to accept a packets.Packet object instead of a
packet dictionary.
2022-12-16 15:58:02 -05:00