mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Fallback to tag for any AfterShip tracking that have no checkpoints (#45053)
This commit is contained in:
parent
e83ced6737
commit
8ce32d67f9
@ -181,8 +181,8 @@ class AfterShipSensor(Entity):
|
|||||||
track["tracking_number"] if track["title"] is None else track["title"]
|
track["tracking_number"] if track["title"] is None else track["title"]
|
||||||
)
|
)
|
||||||
last_checkpoint = (
|
last_checkpoint = (
|
||||||
"Shipment pending"
|
f"Shipment {track['tag'].lower()}"
|
||||||
if track["tag"] == "Pending"
|
if not track["checkpoints"]
|
||||||
else track["checkpoints"][-1]
|
else track["checkpoints"][-1]
|
||||||
)
|
)
|
||||||
status_counts[status] = status_counts.get(status, 0) + 1
|
status_counts[status] = status_counts.get(status, 0) + 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user