python-roku
python-roku copied to clipboard
Fuzzy Finding Apps by Name
_app_for_name() used to use an equality operator to check for a match, meaning that you had to know the full and exact name of the app you wished to invoke. This function now does a find operation on the app.name string, allowing for a partial match of the app name.
It's worth noting that this change should be immediately merge-able without affecting existing implementations, as this does not change the function signature nor the return value. Most notably that it will not change the matched app for an exact match.
@metagrapher thanks for the contribution! If we're going to go with fuzzy matching, I'm trying to think through other scenarios here. Would we want to potentially ignore case as well with something like app.name.lower().find(name.lower())
? What if we kept the get item access as it was but add a method that does fuzzy matching and returns multiple results? Just want to consider different scenarios before committing to something.