mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Remove redundant source_type property from TrackerEntities (#126717)
This commit is contained in:
parent
7e41b40441
commit
a3c2a7e1e0
@ -7,7 +7,7 @@ from typing import Any
|
|||||||
|
|
||||||
from bimmer_connected.vehicle import MyBMWVehicle
|
from bimmer_connected.vehicle import MyBMWVehicle
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType, TrackerEntity
|
from homeassistant.components.device_tracker import TrackerEntity
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
@ -84,8 +84,3 @@ class BMWDeviceTracker(BMWBaseEntity, TrackerEntity):
|
|||||||
and self.vehicle.vehicle_location.location
|
and self.vehicle.vehicle_location.location
|
||||||
else None
|
else None
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""Support for the Geofency device tracker platform."""
|
"""Support for the Geofency device tracker platform."""
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType, TrackerEntity
|
from homeassistant.components.device_tracker import TrackerEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ATTR_LATITUDE, ATTR_LONGITUDE
|
from homeassistant.const import ATTR_LATITUDE, ATTR_LONGITUDE
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
@ -97,11 +97,6 @@ class GeofencyEntity(TrackerEntity, RestoreEntity):
|
|||||||
name=self._name,
|
name=self._name,
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
async def async_added_to_hass(self) -> None:
|
async def async_added_to_hass(self) -> None:
|
||||||
"""Register state update callback."""
|
"""Register state update callback."""
|
||||||
await super().async_added_to_hass()
|
await super().async_added_to_hass()
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""Support for the GPSLogger device tracking."""
|
"""Support for the GPSLogger device tracking."""
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType, TrackerEntity
|
from homeassistant.components.device_tracker import TrackerEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_BATTERY_LEVEL,
|
ATTR_BATTERY_LEVEL,
|
||||||
@ -117,11 +117,6 @@ class GPSLoggerEntity(TrackerEntity, RestoreEntity):
|
|||||||
name=self._name,
|
name=self._name,
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
async def async_added_to_hass(self) -> None:
|
async def async_added_to_hass(self) -> None:
|
||||||
"""Register state update callback."""
|
"""Register state update callback."""
|
||||||
await super().async_added_to_hass()
|
await super().async_added_to_hass()
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""Creates the device tracker entity for the mower."""
|
"""Creates the device tracker entity for the mower."""
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType, TrackerEntity
|
from homeassistant.components.device_tracker import TrackerEntity
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
@ -37,11 +37,6 @@ class AutomowerDeviceTrackerEntity(AutomowerBaseEntity, TrackerEntity):
|
|||||||
super().__init__(mower_id, coordinator)
|
super().__init__(mower_id, coordinator)
|
||||||
self._attr_unique_id = mower_id
|
self._attr_unique_id = mower_id
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type of the device."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def latitude(self) -> float:
|
def latitude(self) -> float:
|
||||||
"""Return latitude value of the device."""
|
"""Return latitude value of the device."""
|
||||||
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType, TrackerEntity
|
from homeassistant.components.device_tracker import TrackerEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
|
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
|
||||||
from homeassistant.helpers.device_registry import DeviceInfo
|
from homeassistant.helpers.device_registry import DeviceInfo
|
||||||
@ -87,11 +87,6 @@ class IcloudTrackerEntity(TrackerEntity):
|
|||||||
"""Return the battery level of the device."""
|
"""Return the battery level of the device."""
|
||||||
return self._device.battery_level
|
return self._device.battery_level
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def icon(self) -> str:
|
def icon(self) -> str:
|
||||||
"""Return the icon."""
|
"""Return the icon."""
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""Support for the Locative platform."""
|
"""Support for the Locative platform."""
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType, TrackerEntity
|
from homeassistant.components.device_tracker import TrackerEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
@ -59,11 +59,6 @@ class LocativeEntity(TrackerEntity):
|
|||||||
"""Return the name of the device."""
|
"""Return the name of the device."""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
async def async_added_to_hass(self) -> None:
|
async def async_added_to_hass(self) -> None:
|
||||||
"""Register state update callback."""
|
"""Register state update callback."""
|
||||||
self._unsub_dispatcher = async_dispatcher_connect(
|
self._unsub_dispatcher = async_dispatcher_connect(
|
||||||
|
@ -5,7 +5,6 @@ from homeassistant.components.device_tracker import (
|
|||||||
ATTR_GPS,
|
ATTR_GPS,
|
||||||
ATTR_GPS_ACCURACY,
|
ATTR_GPS_ACCURACY,
|
||||||
ATTR_LOCATION_NAME,
|
ATTR_LOCATION_NAME,
|
||||||
SourceType,
|
|
||||||
TrackerEntity,
|
TrackerEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
@ -103,11 +102,6 @@ class MobileAppEntity(TrackerEntity, RestoreEntity):
|
|||||||
"""Return the name of the device."""
|
"""Return the name of the device."""
|
||||||
return self._entry.data[ATTR_DEVICE_NAME]
|
return self._entry.data[ATTR_DEVICE_NAME]
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_info(self):
|
def device_info(self):
|
||||||
"""Return the device info."""
|
"""Return the device info."""
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType, TrackerEntity
|
from homeassistant.components.device_tracker import TrackerEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import Platform
|
from homeassistant.const import Platform
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
@ -60,11 +60,6 @@ class MySensorsDeviceTracker(MySensorsChildEntity, TrackerEntity):
|
|||||||
"""Return longitude value of the device."""
|
"""Return longitude value of the device."""
|
||||||
return self._longitude
|
return self._longitude
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type of the device."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _async_update(self) -> None:
|
def _async_update(self) -> None:
|
||||||
"""Update the controller with the latest value from a device."""
|
"""Update the controller with the latest value from a device."""
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""StarLine device tracker."""
|
"""StarLine device tracker."""
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType, TrackerEntity
|
from homeassistant.components.device_tracker import TrackerEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -56,8 +56,3 @@ class StarlineDeviceTracker(StarlineEntity, TrackerEntity, RestoreEntity):
|
|||||||
def longitude(self):
|
def longitude(self):
|
||||||
"""Return longitude value of the device."""
|
"""Return longitude value of the device."""
|
||||||
return self._device.position["y"]
|
return self._device.position["y"]
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
@ -6,7 +6,6 @@ from typing import Any
|
|||||||
|
|
||||||
from subarulink.const import LATITUDE, LONGITUDE, TIMESTAMP
|
from subarulink.const import LATITUDE, LONGITUDE, TIMESTAMP
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType
|
|
||||||
from homeassistant.components.device_tracker.config_entry import TrackerEntity
|
from homeassistant.components.device_tracker.config_entry import TrackerEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@ -78,11 +77,6 @@ class SubaruDeviceTracker(
|
|||||||
"""Return longitude value of the vehicle."""
|
"""Return longitude value of the vehicle."""
|
||||||
return self.coordinator.data[self.vin][VEHICLE_STATUS].get(LONGITUDE)
|
return self.coordinator.data[self.vin][VEHICLE_STATUS].get(LONGITUDE)
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type of the vehicle."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
"""Return if entity is available."""
|
"""Return if entity is available."""
|
||||||
|
@ -6,7 +6,6 @@ import logging
|
|||||||
|
|
||||||
from homeassistant.components.device_tracker import (
|
from homeassistant.components.device_tracker import (
|
||||||
DOMAIN as DEVICE_TRACKER_DOMAIN,
|
DOMAIN as DEVICE_TRACKER_DOMAIN,
|
||||||
SourceType,
|
|
||||||
TrackerEntity,
|
TrackerEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.const import STATE_HOME, STATE_NOT_HOME
|
from homeassistant.const import STATE_HOME, STATE_NOT_HOME
|
||||||
@ -170,8 +169,3 @@ class TadoDeviceTrackerEntity(TrackerEntity):
|
|||||||
def longitude(self) -> None:
|
def longitude(self) -> None:
|
||||||
"""Return longitude value of the device."""
|
"""Return longitude value of the device."""
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType
|
|
||||||
from homeassistant.components.device_tracker.config_entry import TrackerEntity
|
from homeassistant.components.device_tracker.config_entry import TrackerEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@ -64,11 +63,6 @@ class TeslaFleetDeviceTrackerEntity(
|
|||||||
"""Return longitude value of the device."""
|
"""Return longitude value of the device."""
|
||||||
return self._attr_longitude
|
return self._attr_longitude
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type of the device tracker."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
|
|
||||||
class TeslaFleetDeviceTrackerLocationEntity(TeslaFleetDeviceTrackerEntity):
|
class TeslaFleetDeviceTrackerLocationEntity(TeslaFleetDeviceTrackerEntity):
|
||||||
"""Vehicle Location device tracker Class."""
|
"""Vehicle Location device tracker Class."""
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType
|
|
||||||
from homeassistant.components.device_tracker.config_entry import TrackerEntity
|
from homeassistant.components.device_tracker.config_entry import TrackerEntity
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -62,11 +61,6 @@ class TeslemetryDeviceTrackerEntity(TeslemetryVehicleEntity, TrackerEntity):
|
|||||||
"""Return longitude value of the device."""
|
"""Return longitude value of the device."""
|
||||||
return self.get(self.lon_key)
|
return self.get(self.lon_key)
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type of the device tracker."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
|
|
||||||
class TeslemetryDeviceTrackerLocationEntity(TeslemetryDeviceTrackerEntity):
|
class TeslemetryDeviceTrackerLocationEntity(TeslemetryDeviceTrackerEntity):
|
||||||
"""Vehicle location device tracker class."""
|
"""Vehicle location device tracker class."""
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType
|
|
||||||
from homeassistant.components.device_tracker.config_entry import TrackerEntity
|
from homeassistant.components.device_tracker.config_entry import TrackerEntity
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -43,11 +42,6 @@ class TessieDeviceTrackerEntity(TessieEntity, TrackerEntity):
|
|||||||
"""Initialize the device tracker."""
|
"""Initialize the device tracker."""
|
||||||
super().__init__(vehicle, self.key)
|
super().__init__(vehicle, self.key)
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type of the device tracker."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
|
|
||||||
class TessieDeviceTrackerLocationEntity(TessieDeviceTrackerEntity):
|
class TessieDeviceTrackerLocationEntity(TessieDeviceTrackerEntity):
|
||||||
"""Vehicle Location Device Tracker Class."""
|
"""Vehicle Location Device Tracker Class."""
|
||||||
|
@ -6,11 +6,7 @@ import logging
|
|||||||
|
|
||||||
from pytile.tile import Tile
|
from pytile.tile import Tile
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import (
|
from homeassistant.components.device_tracker import AsyncSeeCallback, TrackerEntity
|
||||||
AsyncSeeCallback,
|
|
||||||
SourceType,
|
|
||||||
TrackerEntity,
|
|
||||||
)
|
|
||||||
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
||||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
@ -131,11 +127,6 @@ class TileDeviceTracker(CoordinatorEntity[DataUpdateCoordinator[None]], TrackerE
|
|||||||
return None
|
return None
|
||||||
return self._tile.longitude
|
return self._tile.longitude
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _handle_coordinator_update(self) -> None:
|
def _handle_coordinator_update(self) -> None:
|
||||||
"""Respond to a DataUpdateCoordinator update."""
|
"""Respond to a DataUpdateCoordinator update."""
|
||||||
|
@ -5,7 +5,7 @@ from __future__ import annotations
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType, TrackerEntity
|
from homeassistant.components.device_tracker import TrackerEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers import device_registry as dr
|
from homeassistant.helpers import device_registry as dr
|
||||||
@ -163,11 +163,6 @@ class TraccarEntity(TrackerEntity, RestoreEntity):
|
|||||||
identifiers={(DOMAIN, self._unique_id)},
|
identifiers={(DOMAIN, self._unique_id)},
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
async def async_added_to_hass(self) -> None:
|
async def async_added_to_hass(self) -> None:
|
||||||
"""Register state update callback."""
|
"""Register state update callback."""
|
||||||
await super().async_added_to_hass()
|
await super().async_added_to_hass()
|
||||||
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType, TrackerEntity
|
from homeassistant.components.device_tracker import TrackerEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -57,8 +57,3 @@ class TraccarServerDeviceTracker(TraccarServerEntity, TrackerEntity):
|
|||||||
def location_accuracy(self) -> int:
|
def location_accuracy(self) -> int:
|
||||||
"""Return the gps accuracy of the device."""
|
"""Return the gps accuracy of the device."""
|
||||||
return self.traccar_position["accuracy"]
|
return self.traccar_position["accuracy"]
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from volvooncall.dashboard import Instrument
|
from volvooncall.dashboard import Instrument
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import SourceType, TrackerEntity
|
from homeassistant.components.device_tracker import TrackerEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
@ -61,11 +61,6 @@ class VolvoTrackerEntity(VolvoEntity, TrackerEntity):
|
|||||||
_, longitude = self._get_pos()
|
_, longitude = self._get_pos()
|
||||||
return longitude
|
return longitude
|
||||||
|
|
||||||
@property
|
|
||||||
def source_type(self) -> SourceType:
|
|
||||||
"""Return the source type (GPS)."""
|
|
||||||
return SourceType.GPS
|
|
||||||
|
|
||||||
def _get_pos(self) -> tuple[float, float]:
|
def _get_pos(self) -> tuple[float, float]:
|
||||||
volvo_data = self.coordinator.volvo_data
|
volvo_data = self.coordinator.volvo_data
|
||||||
instrument = volvo_data.instrument(
|
instrument = volvo_data.instrument(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user