Compare commits

..

10 Commits
2.7.4 ... 2.7.5

Author SHA1 Message Date
github-actions
776debcc86 bump version to 2.7.5 2025-11-18 19:48:40 +00:00
Ian McEwen
1088cc607e Merge branch 'revert-close-refactor' 2025-11-13 12:10:46 -07:00
Ian McEwen
aeec5447ed Revert "Merge pull request #841 from SpudGunMan/master"
This reverts commit b4662251ed, reversing
changes made to 2065598754.
2025-11-13 12:08:42 -07:00
Ian McEwen
096fec95c8 Revert "Wrap double-close in a try-catch. Slightly ugly but oh well."
This reverts commit dbc0101a7a.
2025-11-13 12:07:48 -07:00
Ian McEwen
dea5f788a2 Revert "Add more exception logging, fix some additional stream read/write issues"
This reverts commit f15a0bdc0b.
2025-11-13 12:07:32 -07:00
Ian McEwen
f15a0bdc0b Add more exception logging, fix some additional stream read/write issues 2025-11-13 11:38:00 -07:00
Ian McEwen
0906fc6bc0 Merge pull request #858 from Travis-L-R/conf_work
Splitting out true_defaults for moduleConfig in export_config()
2025-11-12 10:16:19 -07:00
Travis-L-R
ccb530574b Splitting true_defaults for moduleConfig out in export_config() 2025-11-11 21:03:01 +10:30
Ian McEwen
dbc0101a7a Wrap double-close in a try-catch. Slightly ugly but oh well. 2025-11-10 13:58:12 -07:00
Ian McEwen
debbb8caeb Update some dependencies 2025-11-10 13:09:44 -07:00
4 changed files with 3305 additions and 1717 deletions

View File

@@ -1147,13 +1147,16 @@ def export_config(interface) -> str:
configObj = {}
# A list of configuration keys that should be set to False if they are missing
true_defaults = {
config_true_defaults = {
("bluetooth", "enabled"),
("lora", "sx126xRxBoostedGain"),
("lora", "txEnabled"),
("lora", "usePreset"),
("position", "positionBroadcastSmartEnabled"),
("security", "serialEnabled"),
}
module_true_defaults = {
("mqtt", "encryptionEnabled"),
}
@@ -1215,7 +1218,7 @@ def export_config(interface) -> str:
else:
configObj["config"] = config
set_missing_flags_false(configObj["config"], true_defaults)
set_missing_flags_false(configObj["config"], config_true_defaults)
module_config = MessageToDict(interface.localNode.moduleConfig)
if module_config:
@@ -1229,6 +1232,8 @@ def export_config(interface) -> str:
else:
configObj["module_config"] = prefs
set_missing_flags_false(configObj["module_config"], module_true_defaults)
config_txt = "# start of Meshtastic configure yaml\n" #checkme - "config" (now changed to config_out)
#was used as a string here and a Dictionary above
config_txt += yaml.dump(configObj)

View File

@@ -94,16 +94,10 @@ class SerialInterface(StreamInterface):
def close(self) -> None:
"""Close a connection to the device"""
if hasattr(self, "stream") and self.stream and getattr(self.stream, "is_open", False):
try:
self.stream.flush()
time.sleep(0.1)
except Exception as e:
logger.debug(f"Exception during flush: {e}")
try:
self.stream.close()
except Exception as e:
logger.debug(f"Exception during close: {e}")
self.stream = None
if self.stream: # Stream can be null if we were already closed
self.stream.flush() # FIXME: why are there these two flushes with 100ms sleeps? This shouldn't be necessary
time.sleep(0.1)
self.stream.flush()
time.sleep(0.1)
logger.debug("Closing Serial stream")
StreamInterface.close(self)

4989
poetry.lock generated
View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +1,20 @@
[tool.poetry]
name = "meshtastic"
version = "2.7.4"
version = "2.7.5"
description = "Python API & client shell for talking to Meshtastic devices"
authors = ["Meshtastic Developers <contact@meshtastic.org>"]
license = "GPL-3.0-only"
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.9,<3.14" # 3.9 is needed for pandas, bleak requires <3.14
python = "^3.9,<3.15" # 3.9 is needed for pandas
pyserial = "^3.5"
protobuf = ">=4.21.12"
tabulate = "^0.9.0"
requests = "^2.31.0"
pyyaml = "^6.0.1"
pypubsub = "^4.0.3"
bleak = "^0.22.3"
bleak = ">=0.22.3"
packaging = "^24.0"
argcomplete = { version = "^3.5.2", optional = true }
pyqrcode = { version = "^1.2.1", optional = true }
@@ -34,7 +34,7 @@ pytest-cov = "^5.0.0"
pdoc3 = "^0.10.0"
autopep8 = "^2.1.0"
pylint = "^3.2.3"
pyinstaller = "^6.8.0"
pyinstaller = "^6.10.0"
mypy = "^1.10.0"
mypy-protobuf = "^3.3.0"
types-protobuf = "^5.26.0.20240422"