16 Aug
2019
16 Aug
'19
3:42 p.m.
@@ -288,6 +287,10 @@ _has_fm = True _has_sidekey = True
- def __init__(self, *args, **kwargs):
super(H777Radio, self).__init__(*args, **kwargs)
self.SIDEKEYFUNCTION_LIST = ["Off", "Monitor", "Transmit
Power", "Alarm"]
You don't need to do this. Just put SIDEKEYFUNCTION_LIST in the class definition (like _has_sidekey) and use it as self.SIDEKEYFUNCTION_LIST as you do below. Then in the GA-2S class definition, just define it there as well and it will win over the parent's definition as appropriate. Should be two new lines, and the one changed one to use the instance-local version. What you have here is better than the global of course, but if anyone subclasses it and doesn't run super(), then they'd break.
I have some clones of this radio and can test when I go to apply the final one.
--Dan