Skip to content

Commit

Permalink
Make fake driver support specials for testing
Browse files Browse the repository at this point in the history
Related to #10689
  • Loading branch information
kk7ds committed Jun 29, 2023
1 parent 57acec8 commit e28f383
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions chirp/drivers/fake.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ def __init__(self, *a, **k):
super().__init__(*a, **k)
self.settings = {'knob': 5}
self.memories = []
for i in range(1, 11):
for i in range(1, 12):
m = chirp_common.Memory(i, empty=i > 5, name='channel %i' % i)
m.freq = 146520000
self.memories.append(m)
self.memories[-1].extd_number = 'Special'

def get_features(self):
rf = chirp_common.RadioFeatures()
Expand All @@ -31,14 +32,17 @@ def get_features(self):
rf.has_bank = True
rf.valid_name_length = 8
rf.valid_characters = chirp_common.CHARSET_ASCII
rf.valid_special_chans = ['Special']
return rf

def get_memory(self, number):
if number == 'Special':
number = len(self.memories)
return self.memories[number - 1]

def set_memory(self, mem):
LOG.info('Set memory %s' % mem)
self.memories[mem.number - 1] = mem
self.memories[mem.number - 1] = mem.dupe()

def get_settings(self):
g = settings.RadioSettingGroup('top', 'Some Settings')
Expand Down

0 comments on commit e28f383

Please sign in to comment.