Skip to content

feat: Expose extra_information attribute from API#75

Open
robbybarnes wants to merge 2 commits intojmdevita:mainfrom
robbybarnes:feature/expose-extra-information-attribute
Open

feat: Expose extra_information attribute from API#75
robbybarnes wants to merge 2 commits intojmdevita:mainfrom
robbybarnes:feature/expose-extra-information-attribute

Conversation

@robbybarnes
Copy link

Summary

Exposes the extra_information field from the ParcelApp API as an attribute on both RecentShipment and ActiveShipment sensors.

Motivation

The API returns an extra_information field that contains carrier-specific details such as:

  • Service type (e.g., "FedEx SmartPost", "UPS Ground")
  • Special handling notes
  • Delivery instructions from the carrier

This information helps users identify packages more precisely, especially when tracking multiple shipments from the same carrier.

Changes

  • Added extra_information to EMPTY_ATTRIBUTES in const.py
  • Updated RecentShipment to extract and expose extra_information
  • Updated ActiveShipment to extract and expose extra_information
  • Gracefully handles missing field (returns None)
  • Updated tests to validate new attribute

Example

For a FedEx package, the attribute might show:

extra_information: "FedEx SmartPost"

This helps distinguish between FedEx Express, Ground, SmartPost, etc.

Testing

  • All tests pass (11/11)
  • Test fixtures already contain extra_information data for validation

robbybarnes and others added 2 commits January 20, 2026 18:18
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>
@PineappleEmperor PineappleEmperor self-requested a review January 24, 2026 12:45
Copy link
Collaborator

@PineappleEmperor PineappleEmperor left a comment

Choose a reason for hiding this comment

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

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.

@robbybarnes
Copy link
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

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