Add update_delivery_times action for frequent delivery-ETA polling - #78
Conversation
The delivery ETA in the announcement shifts often, so the fixed 10-minute refresh can be stale right before the courier arrives. This adds a lightweight rohlikcz.update_delivery_times action that refreshes only the delivery announcements (one request) and notifies entities, so automations can poll it every minute shortly before delivery. Includes an example automation, service description, icon, readme entry and a test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LFCKozF619nbadAAgAGmJY
|
@claude review |
|
Claude finished @dvejsada's task in 2m 8s —— View job Review of PR #78 —
|
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LFCKozF619nbadAAgAGmJY
|
@claude review |
|
Claude finished @dvejsada's task in 1m 40s —— View job Review of PR #78 —
|
Closes #77
What
Adds a lightweight
rohlikcz.update_delivery_timesaction that refreshes only the delivery announcements (a single API request) — the payload that carries the frequently shifting delivery ETA — and immediately notifies entities so the Delivery Time sensor updates. This lets automations poll every minute shortly before a delivery without the cost of a fullupdate_datarefresh, addressing the stale-ETA problem from #77. The order's delivery window (deliverySlot) is fixed once ordered, so it is deliberately not re-fetched.Changes
hub.py: newRohlikAccount.refresh_delivery_times(), modeled onrefresh_slots()— updatesdata["delivery_announcements"]in place and callsasync_update_listeners()services.py/const.py/services.yaml/icons.json: register and describe the new action (config entry selector only, no response)automations/update_delivery_times.yaml: copy-paste example that polls every minute while the ETA is within the next 30 minutes (and up to 10 minutes past it in case the courier is late) — self-regulating, no arming toggle neededreadme.md: action table row, tip linking the example automation, data-updates section mentionmanifest.json: version bump to 0.6.1tests/test_init.py: new test verifying the action updates the Delivery Time sensor from a fresh announcement while leaving other data untouchedTesting
All 23 tests pass (
pytest tests/).🤖 Generated with Claude Code
https://claude.ai/code/session_01LFCKozF619nbadAAgAGmJY
Generated by Claude Code