Skip to content

TH9000: Add programmable buttons to settings. #1310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2025
Merged

Conversation

cmnybo
Copy link
Contributor

@cmnybo cmnybo commented Apr 1, 2025

I added support for configuring the programmable buttons on the THT TH-9000.

@@ -807,6 +867,96 @@ def _filter(name):
int(_freqrange.rxrangehi) / 10))
freqrange.append(rs)

rs = RadioSetting(
"btn_p1", "P1 Short Press",
RadioSettingValueList(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a newer/better way to do this, which is RadioSettingValueMap which tolerates invalid data better than the List variant. This is okay as it is, but you might want to consider converting these to use the map method for better safety in the future.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did use current_index though, which is also good for safety. Just FYI is all.

@kk7ds
Copy link
Owner

kk7ds commented Apr 1, 2025

I squashed the fix patch into the first one. In the future please just do that and update the PR. No need to keep the bad+good commits in the history forever :)

Thanks!

@kk7ds kk7ds merged commit bc27f66 into kk7ds:master Apr 1, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants