feat: Expose delivery window attributes (date_expected_end, timestamps)#73
Open
robbybarnes wants to merge 3 commits intojmdevita:mainfrom
Open
feat: Expose delivery window attributes (date_expected_end, timestamps)#73robbybarnes wants to merge 3 commits intojmdevita:mainfrom
robbybarnes wants to merge 3 commits intojmdevita:mainfrom
Conversation
Adds three new attributes to the ActiveShipment sensor to expose delivery window information when provided by carriers: - date_expected_end: End of delivery window (for carriers that provide time ranges) - timestamp_expected: Epoch timestamp for expected delivery (more precise, includes timezone) - timestamp_expected_end: End of delivery window as epoch timestamp These attributes are already parsed from the API response and stored in the Shipment class but were not previously exposed to Home Assistant. This enables users to create more precise automations based on delivery windows. Also updates EMPTY_ATTRIBUTES in const.py for consistency. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update test assertions to include date_expected_end, timestamp_expected, and timestamp_expected_end attributes that were added to EMPTY_ATTRIBUTES. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PineappleEmperor
requested changes
Jan 24, 2026
Collaborator
PineappleEmperor
left a comment
There was a problem hiding this comment.
A couple of small updates needed before it's good to go I think, namely add a proper test and if the recent sensor can also be updated.
| 'full_description': 'Wireless Mouse Set', | ||
| 'tracking_number': '8217400125612976', | ||
| 'date_expected': tomorrow, | ||
| 'date_expected_end': None, |
Collaborator
There was a problem hiding this comment.
I think ideally here we'd have a test that provides a value other than None. Can you add an update to the recent.json fixture to provide this?
| "full_description": description, | ||
| "tracking_number": tracking_number, | ||
| "date_expected": date_expected, | ||
| "date_expected_end": next_traceable_shipment.date_expected_end, |
Collaborator
There was a problem hiding this comment.
Could this also be added to the Recent sensor?
Per maintainer feedback: - Added date_expected_end, timestamp_expected, timestamp_expected_end attributes to RecentShipment sensor (matching ActiveShipment) - Updated recent.json fixture with actual delivery window values - Updated tests to verify non-None delivery window values - Added dedicated test_delivery_window_attributes test - Fixed TypeError handling for timestamp parsing (caught by CodeRabbit) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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 additional delivery timing attributes from the ParcelApp API that provide more precise delivery window information.
Motivation
The API returns delivery window data that wasn't being exposed:
date_expected_end- End of delivery window (when carriers give a range)timestamp_expected- Unix timestamp of expected deliverytimestamp_expected_end- Unix timestamp of delivery window endThis data is useful for automations that need precise timing, such as:
Changes
date_expected_end,timestamp_expected,timestamp_expected_endto theShipmentclassEMPTY_ATTRIBUTESto include new fieldsActiveShipmentsensor to parse and expose these attributesdatetimeobjectsNew Attributes
date_expected_enddateorNonetimestamp_expecteddatetimeorNonetimestamp_expected_enddatetimeorNoneTesting