From d09b55e1aea971f257edf496ea3873d80e52da04 Mon Sep 17 00:00:00 2001 From: Henk Vergonet Date: Sat, 15 Apr 2023 19:23:28 +0200 Subject: [PATCH] fix: sweep settings and hw version update (#628) * Remove privacy breaches from the HTML documentation Icons and screenshots should not inform distant websites each time an user reads readme.html. The suggestions in this draft are independent and will probably be discussed separately, but they affect a single file so for a first review a single commit is convenient. * fix: sweep settings and hw version update NamedTuples are inmutable either use _replace or use the class itself. * Revert "Remove privacy breaches from the HTML documentation" --------- Co-authored-by: Nicolas Boulenguez --- src/NanoVNASaver/Hardware/NanoVNA_V2.py | 2 +- src/NanoVNASaver/Settings/Sweep.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NanoVNASaver/Hardware/NanoVNA_V2.py b/src/NanoVNASaver/Hardware/NanoVNA_V2.py index d9b8c1b..4af3e0b 100644 --- a/src/NanoVNASaver/Hardware/NanoVNA_V2.py +++ b/src/NanoVNASaver/Hardware/NanoVNA_V2.py @@ -85,7 +85,7 @@ class NanoVNA_V2(VNA): sleep(WRITE_SLEEP) # firmware major version of 0xff indicates dfu mode - if self.version.data["major"] == 0xFF: + if self.version.major == 0xFF: raise IOError("Device is in DFU mode") if "S21 hack" in self.features: diff --git a/src/NanoVNASaver/Settings/Sweep.py b/src/NanoVNASaver/Settings/Sweep.py index d5aef9e..58335bc 100644 --- a/src/NanoVNASaver/Settings/Sweep.py +++ b/src/NanoVNASaver/Settings/Sweep.py @@ -32,7 +32,7 @@ class SweepMode(Enum): AVERAGE = 2 -class Properties(NamedTuple): +class Properties: name: str = "" mode: "SweepMode" = SweepMode.SINGLE averages: tuple[int, int] = (3, 0)