Skip to content

Commit 3954fbd

Browse files
committed
fix misc lint, test, type complaints from CI
1 parent 0fb72b8 commit 3954fbd

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

meshtastic/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ def onConnected(interface):
442442
channelIndex = mt_config.channel_index or 0
443443
if checkChannel(interface, channelIndex):
444444
print(
445-
f"Sending text message {args.sendtext} to {args.dest} on channelIndex:{channelIndex} {"using PRIVATE_APP port" if args.private else ""}"
445+
f"Sending text message {args.sendtext} to {args.dest} on channelIndex:{channelIndex}"
446+
f" {'using PRIVATE_APP port' if args.private else ''}"
446447
)
447448
interface.sendText(
448449
args.sendtext,

meshtastic/mesh_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def sendText(
354354
wantResponse: bool = False,
355355
onResponse: Optional[Callable[[dict], Any]] = None,
356356
channelIndex: int = 0,
357-
portNum: int = portnums_pb2.PortNum.TEXT_MESSAGE_APP
357+
portNum: portnums_pb2.PortNum.ValueType = portnums_pb2.PortNum.TEXT_MESSAGE_APP
358358
):
359359
"""Send a utf8 string to some other node, if the node has a display it
360360
will also be shown on the device.

meshtastic/tests/test_main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,10 @@ def test_main_sendtext(capsys):
593593
iface = MagicMock(autospec=SerialInterface)
594594

595595
def mock_sendText(
596-
text, dest, wantAck=False, wantResponse=False, onResponse=None, channelIndex=0
596+
text, dest, wantAck=False, wantResponse=False, onResponse=None, channelIndex=0, portNum=0
597597
):
598598
print("inside mocked sendText")
599-
print(f"{text} {dest} {wantAck} {wantResponse} {channelIndex}")
599+
print(f"{text} {dest} {wantAck} {wantResponse} {channelIndex} {portNum}")
600600

601601
iface.sendText.side_effect = mock_sendText
602602

@@ -620,10 +620,10 @@ def test_main_sendtext_with_channel(capsys):
620620
iface = MagicMock(autospec=SerialInterface)
621621

622622
def mock_sendText(
623-
text, dest, wantAck=False, wantResponse=False, onResponse=None, channelIndex=0
623+
text, dest, wantAck=False, wantResponse=False, onResponse=None, channelIndex=0, portNum=0
624624
):
625625
print("inside mocked sendText")
626-
print(f"{text} {dest} {wantAck} {wantResponse} {channelIndex}")
626+
print(f"{text} {dest} {wantAck} {wantResponse} {channelIndex} {portNum}")
627627

628628
iface.sendText.side_effect = mock_sendText
629629

0 commit comments

Comments
 (0)