mirror of
https://github.com/meshtastic/python.git
synced 2025-12-28 18:37:52 -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 = {}
|
configObj = {}
|
||||||
|
|
||||||
# A list of configuration keys that should be set to False if they are missing
|
# A list of configuration keys that should be set to False if they are missing
|
||||||
true_defaults = {
|
config_true_defaults = {
|
||||||
("bluetooth", "enabled"),
|
("bluetooth", "enabled"),
|
||||||
("lora", "sx126xRxBoostedGain"),
|
("lora", "sx126xRxBoostedGain"),
|
||||||
("lora", "txEnabled"),
|
("lora", "txEnabled"),
|
||||||
("lora", "usePreset"),
|
("lora", "usePreset"),
|
||||||
("position", "positionBroadcastSmartEnabled"),
|
("position", "positionBroadcastSmartEnabled"),
|
||||||
("security", "serialEnabled"),
|
("security", "serialEnabled"),
|
||||||
|
}
|
||||||
|
|
||||||
|
module_true_defaults = {
|
||||||
("mqtt", "encryptionEnabled"),
|
("mqtt", "encryptionEnabled"),
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1215,7 +1218,7 @@ def export_config(interface) -> str:
|
|||||||
else:
|
else:
|
||||||
configObj["config"] = config
|
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)
|
module_config = MessageToDict(interface.localNode.moduleConfig)
|
||||||
if module_config:
|
if module_config:
|
||||||
@@ -1229,6 +1232,8 @@ def export_config(interface) -> str:
|
|||||||
else:
|
else:
|
||||||
configObj["module_config"] = prefs
|
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)
|
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
|
#was used as a string here and a Dictionary above
|
||||||
config_txt += yaml.dump(configObj)
|
config_txt += yaml.dump(configObj)
|
||||||
|
|||||||
@@ -94,16 +94,10 @@ class SerialInterface(StreamInterface):
|
|||||||
|
|
||||||
def close(self) -> None:
|
def close(self) -> None:
|
||||||
"""Close a connection to the device"""
|
"""Close a connection to the device"""
|
||||||
if hasattr(self, "stream") and self.stream and getattr(self.stream, "is_open", False):
|
if self.stream: # Stream can be null if we were already closed
|
||||||
try:
|
self.stream.flush() # FIXME: why are there these two flushes with 100ms sleeps? This shouldn't be necessary
|
||||||
self.stream.flush()
|
time.sleep(0.1)
|
||||||
time.sleep(0.1)
|
self.stream.flush()
|
||||||
except Exception as e:
|
time.sleep(0.1)
|
||||||
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
|
|
||||||
logger.debug("Closing Serial stream")
|
logger.debug("Closing Serial stream")
|
||||||
StreamInterface.close(self)
|
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]
|
[tool.poetry]
|
||||||
name = "meshtastic"
|
name = "meshtastic"
|
||||||
version = "2.7.4"
|
version = "2.7.5"
|
||||||
description = "Python API & client shell for talking to Meshtastic devices"
|
description = "Python API & client shell for talking to Meshtastic devices"
|
||||||
authors = ["Meshtastic Developers <contact@meshtastic.org>"]
|
authors = ["Meshtastic Developers <contact@meshtastic.org>"]
|
||||||
license = "GPL-3.0-only"
|
license = "GPL-3.0-only"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[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"
|
pyserial = "^3.5"
|
||||||
protobuf = ">=4.21.12"
|
protobuf = ">=4.21.12"
|
||||||
tabulate = "^0.9.0"
|
tabulate = "^0.9.0"
|
||||||
requests = "^2.31.0"
|
requests = "^2.31.0"
|
||||||
pyyaml = "^6.0.1"
|
pyyaml = "^6.0.1"
|
||||||
pypubsub = "^4.0.3"
|
pypubsub = "^4.0.3"
|
||||||
bleak = "^0.22.3"
|
bleak = ">=0.22.3"
|
||||||
packaging = "^24.0"
|
packaging = "^24.0"
|
||||||
argcomplete = { version = "^3.5.2", optional = true }
|
argcomplete = { version = "^3.5.2", optional = true }
|
||||||
pyqrcode = { version = "^1.2.1", optional = true }
|
pyqrcode = { version = "^1.2.1", optional = true }
|
||||||
@@ -34,7 +34,7 @@ pytest-cov = "^5.0.0"
|
|||||||
pdoc3 = "^0.10.0"
|
pdoc3 = "^0.10.0"
|
||||||
autopep8 = "^2.1.0"
|
autopep8 = "^2.1.0"
|
||||||
pylint = "^3.2.3"
|
pylint = "^3.2.3"
|
||||||
pyinstaller = "^6.8.0"
|
pyinstaller = "^6.10.0"
|
||||||
mypy = "^1.10.0"
|
mypy = "^1.10.0"
|
||||||
mypy-protobuf = "^3.3.0"
|
mypy-protobuf = "^3.3.0"
|
||||||
types-protobuf = "^5.26.0.20240422"
|
types-protobuf = "^5.26.0.20240422"
|
||||||
|
|||||||
Reference in New Issue
Block a user