mirror of
https://github.com/meshtastic/python.git
synced 2025-12-26 01:17:51 -05:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
776debcc86 | ||
|
|
1088cc607e | ||
|
|
aeec5447ed | ||
|
|
096fec95c8 | ||
|
|
dea5f788a2 | ||
|
|
f15a0bdc0b | ||
|
|
0906fc6bc0 | ||
|
|
ccb530574b | ||
|
|
dbc0101a7a | ||
|
|
debbb8caeb |
@@ -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)
|
||||
|
||||
@@ -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
4989
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user