mirror of
https://github.com/meshtastic/python.git
synced 2026-01-10 08:47:56 -05:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d27be003c7 | ||
|
|
8e39a00c30 | ||
|
|
055da95b8a | ||
|
|
0c2ad5c77c | ||
|
|
0a88ca6a5c | ||
|
|
51079d4f25 | ||
|
|
4ca3b4bf58 | ||
|
|
25d42d3361 | ||
|
|
a1bffe4f26 | ||
|
|
b87630803f |
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -13,11 +13,10 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version:
|
python-version:
|
||||||
- "3.6"
|
|
||||||
- "3.7"
|
|
||||||
- "3.8"
|
- "3.8"
|
||||||
- "3.9"
|
- "3.9"
|
||||||
- "3.10"
|
- "3.10"
|
||||||
|
- "3.11"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install Python 3
|
- name: Install Python 3
|
||||||
@@ -55,11 +54,10 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version:
|
python-version:
|
||||||
- "3.6"
|
|
||||||
- "3.7"
|
|
||||||
- "3.8"
|
- "3.8"
|
||||||
- "3.9"
|
- "3.9"
|
||||||
- "3.10"
|
- "3.10"
|
||||||
|
- "3.11"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install Python 3
|
- name: Install Python 3
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Note: Docs are generated from this command below, albeit from Vercel.
|
# Note: Docs are generated from this command below, albeit from Vercel.
|
||||||
# The docs/ dir is not used and is no longer commited.
|
# The docs/ dir is not used and is no longer committed.
|
||||||
# see sachaw if you have questions
|
# see sachaw if you have questions
|
||||||
pdoc3 --html -f --output-dir docs meshtastic
|
pdoc3 --html -f --output-dir docs meshtastic
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ LOCAL_ADDR = "^local"
|
|||||||
"""A special ID that means the local node"""
|
"""A special ID that means the local node"""
|
||||||
|
|
||||||
BROADCAST_NUM = 0xFFFFFFFF
|
BROADCAST_NUM = 0xFFFFFFFF
|
||||||
"""if using 8 bit nodenums this will be shortend on the target"""
|
"""if using 8 bit nodenums this will be shortened on the target"""
|
||||||
|
|
||||||
BROADCAST_ADDR = "^all"
|
BROADCAST_ADDR = "^all"
|
||||||
"""A special ID that means broadcast"""
|
"""A special ID that means broadcast"""
|
||||||
@@ -172,7 +172,7 @@ def _onNodeInfoReceive(iface, asDict):
|
|||||||
# update node DB as needed
|
# update node DB as needed
|
||||||
n = iface._getOrCreateByNum(asDict["from"])
|
n = iface._getOrCreateByNum(asDict["from"])
|
||||||
n["user"] = p
|
n["user"] = p
|
||||||
# We now have a node ID, make sure it is uptodate in that table
|
# We now have a node ID, make sure it is up-to-date in that table
|
||||||
iface.nodes[p["id"]] = n
|
iface.nodes[p["id"]] = n
|
||||||
_receiveInfoUpdate(iface, asDict)
|
_receiveInfoUpdate(iface, asDict)
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ class MeshInterface:
|
|||||||
"""Show table summary of nodes in mesh"""
|
"""Show table summary of nodes in mesh"""
|
||||||
|
|
||||||
def formatFloat(value, precision=2, unit=""):
|
def formatFloat(value, precision=2, unit=""):
|
||||||
"""Format a float value with precsion."""
|
"""Format a float value with precision."""
|
||||||
return f"{value:.{precision}f}{unit}" if value else None
|
return f"{value:.{precision}f}{unit}" if value else None
|
||||||
|
|
||||||
def getLH(ts):
|
def getLH(ts):
|
||||||
@@ -704,13 +704,6 @@ class MeshInterface:
|
|||||||
"For more information see https://tinyurl.com/5bjsxu32"
|
"For more information see https://tinyurl.com/5bjsxu32"
|
||||||
)
|
)
|
||||||
|
|
||||||
# check for firmware too old
|
|
||||||
if self.myInfo.max_channels == 0:
|
|
||||||
failmsg = (
|
|
||||||
"This version of meshtastic-python requires device firmware version 1.2 or later. "
|
|
||||||
"For more information see https://tinyurl.com/5bjsxu32"
|
|
||||||
)
|
|
||||||
|
|
||||||
if failmsg:
|
if failmsg:
|
||||||
self.failure = Exception(failmsg)
|
self.failure = Exception(failmsg)
|
||||||
self.isConnected.set() # let waitConnected return this exception
|
self.isConnected.set() # let waitConnected return this exception
|
||||||
@@ -843,7 +836,7 @@ class MeshInterface:
|
|||||||
if nodeNum in self.nodesByNum:
|
if nodeNum in self.nodesByNum:
|
||||||
return self.nodesByNum[nodeNum]
|
return self.nodesByNum[nodeNum]
|
||||||
else:
|
else:
|
||||||
n = {"num": nodeNum} # Create a minimial node db entry
|
n = {"num": nodeNum} # Create a minimal node db entry
|
||||||
self.nodesByNum[nodeNum] = n
|
self.nodesByNum[nodeNum] = n
|
||||||
return n
|
return n
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -221,7 +221,7 @@ class Node:
|
|||||||
return ch
|
return ch
|
||||||
|
|
||||||
def deleteChannel(self, channelIndex):
|
def deleteChannel(self, channelIndex):
|
||||||
"""Delete the specifed channelIndex and shift other channels up"""
|
"""Delete the specified channelIndex and shift other channels up"""
|
||||||
ch = self.channels[channelIndex]
|
ch = self.channels[channelIndex]
|
||||||
if ch.role not in (
|
if ch.role not in (
|
||||||
channel_pb2.Channel.Role.SECONDARY,
|
channel_pb2.Channel.Role.SECONDARY,
|
||||||
@@ -654,7 +654,7 @@ class Node:
|
|||||||
return
|
return
|
||||||
|
|
||||||
c = p["decoded"]["admin"]["raw"].get_device_metadata_response
|
c = p["decoded"]["admin"]["raw"].get_device_metadata_response
|
||||||
self._timeout.reset() # We made foreward progress
|
self._timeout.reset() # We made forward progress
|
||||||
logging.debug(f"Received metadata {stripnl(c)}")
|
logging.debug(f"Received metadata {stripnl(c)}")
|
||||||
print(f"\nfirmware_version: {c.firmware_version}")
|
print(f"\nfirmware_version: {c.firmware_version}")
|
||||||
print(f"device_state_version: {c.device_state_version}")
|
print(f"device_state_version: {c.device_state_version}")
|
||||||
@@ -681,7 +681,7 @@ class Node:
|
|||||||
|
|
||||||
c = p["decoded"]["admin"]["raw"].get_channel_response
|
c = p["decoded"]["admin"]["raw"].get_channel_response
|
||||||
self.partialChannels.append(c)
|
self.partialChannels.append(c)
|
||||||
self._timeout.reset() # We made foreward progress
|
self._timeout.reset() # We made forward progress
|
||||||
logging.debug(f"Received channel {stripnl(c)}")
|
logging.debug(f"Received channel {stripnl(c)}")
|
||||||
index = c.index
|
index = c.index
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class StreamInterface(MeshInterface):
|
|||||||
|
|
||||||
# Send some bogus UART characters to force a sleeping device to wake, and
|
# Send some bogus UART characters to force a sleeping device to wake, and
|
||||||
# if the reading statemachine was parsing a bad packet make sure
|
# if the reading statemachine was parsing a bad packet make sure
|
||||||
# we write enought start bytes to force it to resync (we don't use START1
|
# we write enough start bytes to force it to resync (we don't use START1
|
||||||
# because we want to ensure it is looking for START1)
|
# because we want to ensure it is looking for START1)
|
||||||
p = bytearray([START2] * 32)
|
p = bytearray([START2] * 32)
|
||||||
self._writeBytes(p)
|
self._writeBytes(p)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import subprocess
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
# Do not like using hard coded sleeps, but it probably makes
|
# Do not like using hard coded sleeps, but it probably makes
|
||||||
# sense to pause for the radio at apprpriate times
|
# sense to pause for the radio at appropriate times
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from ..util import findPorts
|
from ..util import findPorts
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import subprocess
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
# Do not like using hard coded sleeps, but it probably makes
|
# Do not like using hard coded sleeps, but it probably makes
|
||||||
# sense to pause for the radio at apprpriate times
|
# sense to pause for the radio at appropriate times
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from ..util import findPorts
|
from ..util import findPorts
|
||||||
|
|||||||
Submodule protobufs updated: e4396fd499...6f88374ec6
3
setup.py
3
setup.py
@@ -13,7 +13,7 @@ with open("README.md", "r") as fh:
|
|||||||
# This call to setup() does all the work
|
# This call to setup() does all the work
|
||||||
setup(
|
setup(
|
||||||
name="meshtastic",
|
name="meshtastic",
|
||||||
version="2.1.8",
|
version="2.1.11",
|
||||||
description="Python API & client shell for talking to Meshtastic devices",
|
description="Python API & client shell for talking to Meshtastic devices",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
@@ -28,6 +28,7 @@ setup(
|
|||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
],
|
],
|
||||||
packages=["meshtastic"],
|
packages=["meshtastic"],
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user