feat: Expose extra_information attribute from API#75
Open
robbybarnes wants to merge 2 commits intojmdevita:mainfrom
Open
feat: Expose extra_information attribute from API#75robbybarnes wants to merge 2 commits intojmdevita:mainfrom
robbybarnes wants to merge 2 commits intojmdevita:mainfrom
Conversation
Adds the extra_information attribute to both RecentShipment and ActiveShipment sensors. This attribute contains additional data required by some carriers for tracking (such as postcode or email address). Changes: - RecentShipment: Added extra_information to attributes dict - ActiveShipment: Added extra_information from next_traceable_shipment - EMPTY_ATTRIBUTES: Added extra_information for consistency The API documentation notes that extra_information "could be a postcode or an email. Something extra that was required by a carrier to track a delivery." Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update test assertions to include the extra_information attribute that was added to RecentShipment and ActiveShipment sensors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Collaborator
PineappleEmperor
left a comment
There was a problem hiding this comment.
I think this one is good to go. We should switch to proper .get() over try and except blocks though. That'll be a larger rewrite.
Author
|
I'll take a closer look at a larger rewrite and see what that looks like, I'll do that as a separate PR though |
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
Exposes the
extra_informationfield from the ParcelApp API as an attribute on bothRecentShipmentandActiveShipmentsensors.Motivation
The API returns an
extra_informationfield that contains carrier-specific details such as:This information helps users identify packages more precisely, especially when tracking multiple shipments from the same carrier.
Changes
extra_informationtoEMPTY_ATTRIBUTESinconst.pyRecentShipmentto extract and exposeextra_informationActiveShipmentto extract and exposeextra_informationNone)Example
For a FedEx package, the attribute might show:
This helps distinguish between FedEx Express, Ground, SmartPost, etc.
Testing
extra_informationdata for validation