add unit test for --set-owner and --set-ham; refactor setting encryption after

This commit is contained in:
Mike Kinney
2021-12-12 10:30:28 -08:00
parent 34d31711ad
commit d2d7c9fb0e
3 changed files with 69 additions and 12 deletions

View File

@@ -5,7 +5,7 @@ import logging
import base64
from google.protobuf.json_format import MessageToJson
from . import portnums_pb2, apponly_pb2, admin_pb2, channel_pb2
from .util import pskToString, stripnl, Timeout, our_exit
from .util import pskToString, stripnl, Timeout, our_exit, fromPSK
class Node:
@@ -56,6 +56,12 @@ class Node:
self._requestSettings()
def turnOffEncryptionOnPrimaryChannel(self):
"""Turn off encryption on primary channel."""
self.channels[0].settings.psk = fromPSK("none")
print("Writing modified channels to device")
self.writeChannel(0)
def waitForConfig(self):
"""Block until radio config is received. Returns True if config has been received."""
return self._timeout.waitForSet(self, attrs=('radioConfig', 'channels'))