From 674744c213ae0fddabc6c28f9512b526beb45d62 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Sun, 8 Sep 2024 17:53:08 -0700 Subject: [PATCH] Hand-fix some settings list indexes with variables --- chirp/drivers/ga510.py | 6 ++---- chirp/drivers/uvk5.py | 11 +++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/chirp/drivers/ga510.py b/chirp/drivers/ga510.py index e19252ca..4e60940e 100644 --- a/chirp/drivers/ga510.py +++ b/chirp/drivers/ga510.py @@ -483,14 +483,12 @@ def _get_extra(self, _mem): # pttid, signal - cur = PTTID[int(_mem.pttid)] s = RadioSetting('pttid', 'PTTID', - RadioSettingValueList(PTTID, cur)) + RadioSettingValueList(PTTID, int(_mem.pttid))) group.append(s) - cur = SIGNAL[int(_mem.signal)] s = RadioSetting('signal', 'Signal', - RadioSettingValueList(SIGNAL, cur)) + RadioSettingValueList(SIGNAL, int(_mem.signal))) group.append(s) return group diff --git a/chirp/drivers/uvk5.py b/chirp/drivers/uvk5.py index 72fac52d..ed4e9160 100644 --- a/chirp/drivers/uvk5.py +++ b/chirp/drivers/uvk5.py @@ -872,12 +872,8 @@ def _get_mem_extra(self, mem, _mem): mem.extra.append(rs) # PTTID - try: - pttid = self._pttid_list[_mem.dtmf_pttid] - except IndexError: - pttid = 0 rs = RadioSetting("pttid", "PTTID", RadioSettingValueList( - self._pttid_list, pttid)) + self._pttid_list, current_index=_mem.dtmf_pttid)) mem.extra.append(rs) # DTMF DECODE @@ -2009,7 +2005,10 @@ def set_memory(self, mem): _mem.bclo = svalue and 1 or 0 if sname == "pttid": - _mem.dtmf_pttid = self._pttid_list.index(svalue) + try: + _mem.dtmf_pttid = self._pttid_list.index(svalue) + except ValueError: + _mem.dtmf_pttid = 0 if sname == "frev": _mem.freq_reverse = svalue and 1 or 0