Skip to content

Commit

Permalink
Merge branch 'dev' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Jul 7, 2023
2 parents 76a7795 + 672fc04 commit c50186b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/tesla_custom/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,9 @@ def extra_state_attributes(self):
"Energy at arrival": self._car.active_route_energy_at_arrival,
"Minutes traffic delay": minutes,
"Destination": self._car.active_route_destination,
"Minutes to arrival": round(
float(self._car.active_route_minutes_to_arrival), 2
),
}


Expand Down
4 changes: 4 additions & 0 deletions tests/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,10 @@ async def test_arrival_time(hass: HomeAssistant, monkeypatch: MonkeyPatch) -> No
state.attributes.get("Destination")
== car_mock_data.VEHICLE_DATA["drive_state"]["active_route_destination"]
)
assert state.attributes.get("Minutes to arrival") == round(
car_mock_data.VEHICLE_DATA["drive_state"]["active_route_minutes_to_arrival"],
2,
)


async def test_distance_to_arrival(hass: HomeAssistant) -> None:
Expand Down

0 comments on commit c50186b

Please sign in to comment.