diff --git a/homeassistant/components/bmw_connected_drive/const.py b/homeassistant/components/bmw_connected_drive/const.py index 83609d239c1..0f79a16b702 100644 --- a/homeassistant/components/bmw_connected_drive/const.py +++ b/homeassistant/components/bmw_connected_drive/const.py @@ -8,6 +8,8 @@ from homeassistant.const import ( ATTRIBUTION = "Data provided by BMW Connected Drive" +ATTR_DIRECTION = "direction" + CONF_ALLOWED_REGIONS = ["china", "north_america", "rest_of_world"] CONF_READ_ONLY = "read_only" CONF_USE_LOCATION = "use_location" diff --git a/homeassistant/components/bmw_connected_drive/device_tracker.py b/homeassistant/components/bmw_connected_drive/device_tracker.py index 60ca865f94f..90629216641 100644 --- a/homeassistant/components/bmw_connected_drive/device_tracker.py +++ b/homeassistant/components/bmw_connected_drive/device_tracker.py @@ -17,7 +17,7 @@ from . import ( BMWConnectedDriveAccount, BMWConnectedDriveBaseEntity, ) -from .const import CONF_ACCOUNT, DATA_ENTRIES +from .const import ATTR_DIRECTION, CONF_ACCOUNT, DATA_ENTRIES _LOGGER = logging.getLogger(__name__) @@ -80,7 +80,9 @@ class BMWDeviceTracker(BMWConnectedDriveBaseEntity, TrackerEntity): def update(self) -> None: """Update state of the device tracker.""" _LOGGER.debug("Updating device tracker of %s", self._vehicle.name) - self._attr_extra_state_attributes = self._attrs + state_attrs = self._attrs + state_attrs[ATTR_DIRECTION] = self._vehicle.status.gps_heading + self._attr_extra_state_attributes = state_attrs self._location = ( self._vehicle.status.gps_position if self._vehicle.is_vehicle_tracking_enabled