Avoid raw string in device_tracker source_type (#126601)
parent
3d4ac7ca63
commit
2a0c779a02
|
@ -181,7 +181,7 @@ class BaseTrackerEntity(Entity):
|
|||
return None
|
||||
|
||||
@property
|
||||
def source_type(self) -> SourceType | str:
|
||||
def source_type(self) -> SourceType:
|
||||
"""Return the source type, eg gps or router, of the device."""
|
||||
if hasattr(self, "_attr_source_type"):
|
||||
return self._attr_source_type
|
||||
|
|
|
@ -1318,7 +1318,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||
),
|
||||
TypeHintMatch(
|
||||
function_name="source_type",
|
||||
return_type=["SourceType", "str"],
|
||||
return_type="SourceType",
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue