mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 19:25:12 +02:00
Avoid raw string in device_tracker source_type (#126601)
This commit is contained in:
@@ -181,7 +181,7 @@ class BaseTrackerEntity(Entity):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
@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."""
|
||||||
if hasattr(self, "_attr_source_type"):
|
if hasattr(self, "_attr_source_type"):
|
||||||
return self._attr_source_type
|
return self._attr_source_type
|
||||||
|
@@ -1318,7 +1318,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="source_type",
|
function_name="source_type",
|
||||||
return_type=["SourceType", "str"],
|
return_type="SourceType",
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user