OK. That should work for STEP because it changed with BFB291. But other menus that need attention, like VOICE, changed at BFB251. That will probably require a different type of check. For pre-BFB251 the selection is OFF or ON, which is what CHIRP currently supports. But for BFB251 and later the selection is OFF, ENGlish or CHInese. Fortunately most want OFF or ENG so the existing code probably works fine for most users. I'd still like to see it support the menu fully though.
Okay, so lets add another method called _my_version() that returns the integer firmware version:
def _my_version(self): version_tag = _firmware_version_from_image(self) if 'BFB' in version_tag: idx = version_tag.index("BFB") + 3 return int(version_tag[idx:idx+3]) raise Exception("Unrecognized firmware version string")
Then you can check this in other parts of the code, like this:
if self._my_version() >= 251: # do something special
Could also change the other uses of _is_orig() to be something like the above to keep the pattern the same and then nix the actual _is_orig() method once they're all converted. That would make the other special cases more clearly tied to a specific firmware version.
I'll study this a bit before I do anything. I'll probably have questions.
We'll answer 'em!
Thanks :)