[chirp_devel] Inverted Boolean Help Needed
Jim Unroe
Mon Jan 20 18:53:45 PST 2014
The UV-B5/B6 has a ON/OFF setting that is inverted. 0 = ON and 1 = OFF.
I was using a list to get around it. Then I saw in the h777.py driver there
were a pair of inverted settings. It thought I replicated this for my needs
but apparently I didn't do enough testing and what I have is broken. This
is in the uvb5.py driver.
Here is the setting...
rs = RadioSetting("beep_tone", "Beep Prompt",
RadioSettingValueBoolean(not _settings.beep_tone))
basic.append(rs)
And here is the rest...
if element.has_apply_callback():
print "Using apply callback"
element.run_apply_callback()
elif setting == "beep_tone":
print "Setting %s = %s" % (setting, not
(element.value))
setattr(obj, setting, not (element.value))
else:
print "Setting %s = %s" % (setting, element.value)
setattr(obj, setting, element.value)
except Exception, e:
print element.get_name()
raise
No matter if the setting is enabled or disabled, FALSE is always returned
so the Beep Prompt is always enabled.
Can somebody spot what I am doing wrong?
Thanks,
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20140120/137a3d96/attachment-0001.html
More information about the chirp_devel
mailing list