mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 13:47:35 +00:00
Add GPS direction to BMW ConnectedDrive device_tracker (#63744)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
This commit is contained in:
parent
620991fef8
commit
2e25213101
@ -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"
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user