mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
Cleanup source_type type hints in device tracker components (#126592)
This commit is contained in:
parent
61ff40c299
commit
2df6824856
@ -56,7 +56,7 @@ class StarlinkDeviceTrackerEntity(StarlinkEntity, TrackerEntity):
|
|||||||
entity_description: StarlinkDeviceTrackerEntityDescription
|
entity_description: StarlinkDeviceTrackerEntityDescription
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_type(self) -> SourceType | str:
|
def source_type(self) -> SourceType:
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
"""Return the source type, eg gps or router, of the device."""
|
||||||
return SourceType.GPS
|
return SourceType.GPS
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class TeslaFleetDeviceTrackerEntity(
|
|||||||
return self._attr_longitude
|
return self._attr_longitude
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_type(self) -> SourceType | str:
|
def source_type(self) -> SourceType:
|
||||||
"""Return the source type of the device tracker."""
|
"""Return the source type of the device tracker."""
|
||||||
return SourceType.GPS
|
return SourceType.GPS
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ class TessieDeviceTrackerEntity(TessieEntity, TrackerEntity):
|
|||||||
super().__init__(vehicle, self.key)
|
super().__init__(vehicle, self.key)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_type(self) -> SourceType | str:
|
def source_type(self) -> SourceType:
|
||||||
"""Return the source type of the device tracker."""
|
"""Return the source type of the device tracker."""
|
||||||
return SourceType.GPS
|
return SourceType.GPS
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ class VolvoTrackerEntity(VolvoEntity, TrackerEntity):
|
|||||||
return longitude
|
return longitude
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_type(self) -> SourceType | str:
|
def source_type(self) -> SourceType:
|
||||||
"""Return the source type (GPS)."""
|
"""Return the source type (GPS)."""
|
||||||
return SourceType.GPS
|
return SourceType.GPS
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ class MockScannerEntity(ScannerEntity):
|
|||||||
self._mac_address = "ad:de:ef:be:ed:fe"
|
self._mac_address = "ad:de:ef:be:ed:fe"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_type(self):
|
def source_type(self) -> SourceType:
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
"""Return the source type, eg gps or router, of the device."""
|
||||||
return SourceType.ROUTER
|
return SourceType.ROUTER
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ class MockTrackerEntity(TrackerEntity):
|
|||||||
return self._battery_level
|
return self._battery_level
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_type(self) -> SourceType | str:
|
def source_type(self) -> SourceType:
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
"""Return the source type, eg gps or router, of the device."""
|
||||||
return SourceType.GPS
|
return SourceType.GPS
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ class MockScannerEntity(ScannerEntity):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source_type(self) -> SourceType | str:
|
def source_type(self) -> SourceType:
|
||||||
"""Return the source type, eg gps or router, of the device."""
|
"""Return the source type, eg gps or router, of the device."""
|
||||||
return SourceType.ROUTER
|
return SourceType.ROUTER
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user