feat: Add configurable filter_mode option (recent vs active)#76
Open
robbybarnes wants to merge 1 commit intojmdevita:mainfrom
Open
feat: Add configurable filter_mode option (recent vs active)#76robbybarnes wants to merge 1 commit intojmdevita:mainfrom
robbybarnes wants to merge 1 commit intojmdevita:mainfrom
Conversation
Adds a new configuration option allowing users to choose between "recent" and "active" filter modes when fetching parcel data from the API. - "Recent" (default): Includes recently completed deliveries alongside active ones - "Active": Shows only parcels that are still in transit or pending delivery This aligns with the Parcel App API which supports the filter_mode parameter with values "recent" (default) or "active". Changes: - const.py: Added FILTER_MODE_RECENT, FILTER_MODE_ACTIVE, DEFAULT_FILTER_MODE - coordinator.py: Read filter_mode from options and use in API URL - config_flow.py: Added filter_mode dropdown to options schema - translations/en.json: Added filter_mode label and description Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Collaborator
PineappleEmperor
left a comment
There was a problem hiding this comment.
We already provide an ACTIVE sensor and a RECENT sensor that users are free to use/disable depending on what they need. The API request for active data is a superset of the recent data, so there's no need to provide an option for both.
Feel free to respond, but I see this as complexity without purpose.
Author
|
Fair enough. In testing out some changes on my side I just preferred doing it this way, but I don't disagree with what you're saying. No strong feelings either way, I'm good with just closing this one out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a user-configurable
filter_modeoption to control which parcels are fetched from the API.Motivation
The ParcelApp API supports a
filter_modeparameter:recent(default) - Returns all recent parcels including delivered onesactive- Returns only active/in-transit parcelsSome users prefer to see only active shipments to reduce clutter, while others want to see recently delivered packages. This PR gives users the choice.
Related to discussions about completed parcels appearing in the list.
Changes
FILTER_MODE_RECENT,FILTER_MODE_ACTIVE, andDEFAULT_FILTER_MODEconstantsParcelUpdateCoordinatorto read filter_mode from optionsConfiguration
Users can change the filter mode in:
Settings → Devices & Services → Parcel App → Configure
Options:
Testing