From 40d03a6ea19ee2112a2a9759337217577b069921 Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Sun, 11 Aug 2024 10:19:38 -0700 Subject: [PATCH] mess with more stuff to try to make powermon optional --- meshtastic/__main__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/meshtastic/__main__.py b/meshtastic/__main__.py index a433bf3..e7886e6 100644 --- a/meshtastic/__main__.py +++ b/meshtastic/__main__.py @@ -34,15 +34,14 @@ try: from meshtastic.slog import LogSet have_powermon = True powermon_exception = None + meter: Optional[PowerMeter] = None except ImportError as e: have_powermon = False powermon_exception = e + meter = None from meshtastic.protobuf import channel_pb2, config_pb2, portnums_pb2 from meshtastic.version import get_active_version -meter: Optional[PowerMeter] = None - - def onReceive(packet, interface): """Callback invoked when a packet arrives""" args = mt_config.args @@ -897,7 +896,7 @@ def onConnected(interface): qr = pyqrcode.create(url) print(qr.terminal()) - log_set: Optional[LogSet] = None # type: ignore[annotation-unchecked] + log_set: Optional = None # type: ignore[annotation-unchecked] # we need to keep a reference to the logset so it doesn't get GCed early if args.slog or args.power_stress: