mirror of
https://github.com/home-assistant/core
synced 2024-09-09 12:51:22 +02:00
Remove route sensor of here_travel_time (#79211)
This commit is contained in:
parent
473d7c484d
commit
45ecddb9aa
@ -33,7 +33,6 @@ from .const import (
|
|||||||
ATTR_DURATION_IN_TRAFFIC,
|
ATTR_DURATION_IN_TRAFFIC,
|
||||||
ATTR_ORIGIN,
|
ATTR_ORIGIN,
|
||||||
ATTR_ORIGIN_NAME,
|
ATTR_ORIGIN_NAME,
|
||||||
ATTR_ROUTE,
|
|
||||||
CONF_ARRIVAL_TIME,
|
CONF_ARRIVAL_TIME,
|
||||||
CONF_DEPARTURE_TIME,
|
CONF_DEPARTURE_TIME,
|
||||||
CONF_DESTINATION_ENTITY_ID,
|
CONF_DESTINATION_ENTITY_ID,
|
||||||
@ -190,7 +189,6 @@ class HereTravelTimeDataUpdateCoordinator(DataUpdateCoordinator):
|
|||||||
ATTR_DURATION: round(summary["baseTime"] / 60), # type: ignore[misc]
|
ATTR_DURATION: round(summary["baseTime"] / 60), # type: ignore[misc]
|
||||||
ATTR_DURATION_IN_TRAFFIC: round(traffic_time / 60),
|
ATTR_DURATION_IN_TRAFFIC: round(traffic_time / 60),
|
||||||
ATTR_DISTANCE: distance,
|
ATTR_DISTANCE: distance,
|
||||||
ATTR_ROUTE: response.route_short,
|
|
||||||
ATTR_ORIGIN: ",".join(origin),
|
ATTR_ORIGIN: ",".join(origin),
|
||||||
ATTR_DESTINATION: ",".join(destination),
|
ATTR_DESTINATION: ",".join(destination),
|
||||||
ATTR_ORIGIN_NAME: waypoint[0]["mappedRoadName"],
|
ATTR_ORIGIN_NAME: waypoint[0]["mappedRoadName"],
|
||||||
|
@ -69,7 +69,6 @@ UNITS = [CONF_UNIT_SYSTEM_METRIC, CONF_UNIT_SYSTEM_IMPERIAL]
|
|||||||
|
|
||||||
ATTR_DURATION = "duration"
|
ATTR_DURATION = "duration"
|
||||||
ATTR_DISTANCE = "distance"
|
ATTR_DISTANCE = "distance"
|
||||||
ATTR_ROUTE = "route"
|
|
||||||
ATTR_ORIGIN = "origin"
|
ATTR_ORIGIN = "origin"
|
||||||
ATTR_DESTINATION = "destination"
|
ATTR_DESTINATION = "destination"
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ class HERERoutingData(TypedDict):
|
|||||||
ATTR_DURATION: float
|
ATTR_DURATION: float
|
||||||
ATTR_DURATION_IN_TRAFFIC: float
|
ATTR_DURATION_IN_TRAFFIC: float
|
||||||
ATTR_DISTANCE: float
|
ATTR_DISTANCE: float
|
||||||
ATTR_ROUTE: str
|
|
||||||
ATTR_ORIGIN: str
|
ATTR_ORIGIN: str
|
||||||
ATTR_DESTINATION: str
|
ATTR_DESTINATION: str
|
||||||
ATTR_ORIGIN_NAME: str
|
ATTR_ORIGIN_NAME: str
|
||||||
|
@ -38,7 +38,6 @@ from .const import (
|
|||||||
ATTR_DURATION_IN_TRAFFIC,
|
ATTR_DURATION_IN_TRAFFIC,
|
||||||
ATTR_ORIGIN,
|
ATTR_ORIGIN,
|
||||||
ATTR_ORIGIN_NAME,
|
ATTR_ORIGIN_NAME,
|
||||||
ATTR_ROUTE,
|
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
ICON_CAR,
|
ICON_CAR,
|
||||||
ICONS,
|
ICONS,
|
||||||
@ -64,11 +63,6 @@ def sensor_descriptions(travel_mode: str) -> tuple[SensorEntityDescription, ...]
|
|||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=TIME_MINUTES,
|
native_unit_of_measurement=TIME_MINUTES,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
|
||||||
name="Route",
|
|
||||||
icon="mdi:directions",
|
|
||||||
key=ATTR_ROUTE,
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -179,10 +179,6 @@ async def test_sensor(
|
|||||||
hass.states.get("sensor.test_distance").attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
hass.states.get("sensor.test_distance").attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
||||||
== expected_distance_unit
|
== expected_distance_unit
|
||||||
)
|
)
|
||||||
assert hass.states.get("sensor.test_route").state == (
|
|
||||||
"US-29 - K St NW; US-29 - Whitehurst Fwy; "
|
|
||||||
"I-495 N - Capital Beltway; MD-187 S - Old Georgetown Rd"
|
|
||||||
)
|
|
||||||
assert (
|
assert (
|
||||||
hass.states.get("sensor.test_duration_in_traffic").state
|
hass.states.get("sensor.test_duration_in_traffic").state
|
||||||
== expected_duration_in_traffic
|
== expected_duration_in_traffic
|
||||||
|
Loading…
Reference in New Issue
Block a user