Skip to content

Commit

Permalink
Bug Fix: When you try to do 2 things at the same time you end up with…
Browse files Browse the repository at this point in the history
… bugs
  • Loading branch information
0x9900 committed Apr 21, 2024
1 parent 198e5fb commit 00ce98d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions sa818.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ def set_radio(self, opts):
tx_tone, rx_tone = ['0000', '0000']

if opts.offset == 0.0:
tx_freq = rx_freq = "{opts.frequency:.4f}"
tx_freq = rx_freq = f"{opts.frequency:.4f}"
else:
rx_freq = "{opts.frequency:.4f}"
tx_freq = "{opts.frequency + opts.offset:.4f}"
rx_freq = f"{opts.frequency:.4f}"
tx_freq = f"{opts.frequency + opts.offset:.4f}"

cmd = "{self.SETGRP}={opts.bw},{tx_freq},{rx_freq},{tx_tone},{opts.squelch},{rx_tone}"
cmd = f"{self.SETGRP}={opts.bw},{tx_freq},{rx_freq},{tx_tone},{opts.squelch},{rx_tone}"
self.send(cmd)
time.sleep(1)
response = self.readline()
Expand Down Expand Up @@ -161,7 +161,7 @@ def set_radio(self, opts):
def set_filter(self, opts):
_yn = {True: "Yes", False: "No"}
# filters are pre-emphasis, high-pass, low-pass
cmd = "{self.FILTER}={nt(not opts.emphasis)},{int(opts.highpass)},{int(opts.lowpass)}"
cmd = f"{self.FILTER}={int(not opts.emphasis)},{int(opts.highpass)},{int(opts.lowpass)}"
self.send(cmd)
time.sleep(1)
response = self.readline()
Expand All @@ -172,7 +172,7 @@ def set_filter(self, opts):
response, _yn[opts.emphasis], _yn[opts.highpass], _yn[opts.lowpass])

def set_volume(self, opts):
cmd = "{self.VOLUME}={opts.level:d}"
cmd = f"{self.VOLUME}={opts.level:d}"
self.send(cmd)
time.sleep(1)
response = self.readline()
Expand All @@ -183,7 +183,7 @@ def set_volume(self, opts):

def close_tail(self, opts):
_yn = {True: "Yes", False: "No"}
cmd = "{self.TAIL}={int(opts.close_tail)}"
cmd = f"{self.TAIL}={int(opts.close_tail)}"
self.send(cmd)
time.sleep(1)
response = self.readline()
Expand Down Expand Up @@ -246,7 +246,7 @@ def type_dcs(parg):

code, direction = code[:-1], code[-1]
try:
dcs = "{int(code):03d}"
dcs = f"{int(code):03d}"
if dcs not in DCS_CODES:
logger.error(err_msg)
raise argparse.ArgumentError
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"""

__author__ = "Fred C. (W6BSD)"
__version__ = '0.2.3'
__version__ = '0.2.4'
__license__ = 'BSD'

py_version = sys.version_info[:2]
Expand Down

0 comments on commit 00ce98d

Please sign in to comment.