Skip to content

Commit

Permalink
Enhancement: Add score to trip model (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhuijben authored Jul 24, 2024
1 parent 8f5314d commit 256c4ad
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mytoyota/models/trips.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,20 @@ def average_fuel_consumed(self) -> float:

return 0.0

@property
def score(self) -> float:
"""The (hybrid) score for the trip.
Returns
-------
float: The hybrid score for the trip
"""
if self._trip.scores and self._trip.scores.global_:
return self._trip.scores.global_

return 0.0

@property
def route(self) -> Optional[List[Tuple[float, float]]]:
"""The route taken.
Expand Down

0 comments on commit 256c4ad

Please sign in to comment.