Skip to content

Commit

Permalink
Enhancement: Add hybrid_score to trip model
Browse files Browse the repository at this point in the history
  • Loading branch information
rhuijben committed Apr 17, 2024
1 parent e8bd9d1 commit 84b1d30
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mytoyota/models/trips.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,19 @@ def average_fuel_consumed(self) -> float:

return 0.0

@property
def hybrid_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_

Check warning on line 178 in mytoyota/models/trips.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/models/trips.py#L177-L178

Added lines #L177 - L178 were not covered by tests

return 0.0

Check warning on line 180 in mytoyota/models/trips.py

View check run for this annotation

Codecov / codecov/patch

mytoyota/models/trips.py#L180

Added line #L180 was not covered by tests

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

0 comments on commit 84b1d30

Please sign in to comment.