
I want to create a selection for the UV-5R that depending the the users' selection (either tick like Boolean, or a two choice list), one or the other of the following is written.
"\x0E\x0F\x10\x11\x15" "\x00\x00\x00\x00\x00"
You mean a RadioSetting? Maybe something like this untested snipped:
def apply_foobar(setting, obj): if setting.value == True: obj.foobar = "\x0E\x0F\x10\x11\x15" else: obj.foobar = "\x00\x00\x00\x00\x00"
rs = RadioSetting("foobar", "Enable Foobar", RadioSettingBoolean(False)) rs.set_apply_callback(apply_foobar, self._memobj)
Note that it will always default to False unless you change how the RadioSettingBoolean is initialized. The callback "apply_foobar" gets called when the setting is to be applied to the radio, so that's where your logic goes to check the value that the user has chosen and apply it to the memory object.