Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions homeassistant/components/huawei_lte/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from homeassistant.components.device_tracker.config_entry import ScannerEntity
from homeassistant.components.device_tracker.const import (
DOMAIN as DEVICE_TRACKER_DOMAIN,
SOURCE_TYPE_ROUTER,
SourceType,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
Expand Down Expand Up @@ -194,9 +194,9 @@ def _device_unique_id(self) -> str:
return self.mac_address

@property
def source_type(self) -> str:
"""Return SOURCE_TYPE_ROUTER."""
return SOURCE_TYPE_ROUTER
def source_type(self) -> SourceType:
"""Return SourceType.ROUTER."""
return SourceType.ROUTER

@property
def ip_address(self) -> str | None:
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/icloud/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from typing import Any

from homeassistant.components.device_tracker import SOURCE_TYPE_GPS, AsyncSeeCallback
from homeassistant.components.device_tracker import AsyncSeeCallback, SourceType
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
Expand Down Expand Up @@ -105,9 +105,9 @@ def battery_level(self) -> int | None:
return self._device.battery_level

@property
def source_type(self) -> str:
def source_type(self) -> SourceType:
"""Return the source type, eg gps or router, of the device."""
return SOURCE_TYPE_GPS
return SourceType.GPS

@property
def icon(self) -> str:
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/keenetic_ndms2/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from homeassistant.components.device_tracker import (
DOMAIN as DEVICE_TRACKER_DOMAIN,
SOURCE_TYPE_ROUTER,
SourceType,
)
from homeassistant.components.device_tracker.config_entry import ScannerEntity
from homeassistant.config_entries import ConfigEntry
Expand Down Expand Up @@ -109,9 +109,9 @@ def is_connected(self):
)

@property
def source_type(self):
def source_type(self) -> SourceType:
"""Return the source type of the client."""
return SOURCE_TYPE_ROUTER
return SourceType.ROUTER

@property
def name(self) -> str:
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/life360/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections.abc import Mapping
from typing import Any, cast

from homeassistant.components.device_tracker import SOURCE_TYPE_GPS
from homeassistant.components.device_tracker import SourceType
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_BATTERY_CHARGING
Expand Down Expand Up @@ -192,9 +192,9 @@ def battery_level(self) -> int | None:
return self._data.battery_level

@property
def source_type(self) -> str:
def source_type(self) -> SourceType:
"""Return the source type, eg gps or router, of the device."""
return SOURCE_TYPE_GPS
return SourceType.GPS

@property
def location_accuracy(self) -> int:
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/locative/device_tracker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Support for the Locative platform."""
from homeassistant.components.device_tracker import SOURCE_TYPE_GPS
from homeassistant.components.device_tracker import SourceType
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
Expand Down Expand Up @@ -60,9 +60,9 @@ def name(self):
return self._name

@property
def source_type(self):
def source_type(self) -> SourceType:
"""Return the source type, eg gps or router, of the device."""
return SOURCE_TYPE_GPS
return SourceType.GPS

async def async_added_to_hass(self):
"""Register state update callback."""
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/mazda/device_tracker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Platform for Mazda device tracker integration."""
from homeassistant.components.device_tracker import SOURCE_TYPE_GPS
from homeassistant.components.device_tracker import SourceType
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
Expand Down Expand Up @@ -40,9 +40,9 @@ def __init__(self, client, coordinator, index) -> None:
self._attr_unique_id = self.vin

@property
def source_type(self):
def source_type(self) -> SourceType:
"""Return the source type, eg gps or router, of the device."""
return SOURCE_TYPE_GPS
return SourceType.GPS

@property
def latitude(self):
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/meraki/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

from homeassistant.components.device_tracker import (
PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA,
SOURCE_TYPE_ROUTER,
AsyncSeeCallback,
SourceType,
)
from homeassistant.components.http import HomeAssistantView
from homeassistant.core import HomeAssistant, callback
Expand Down Expand Up @@ -127,7 +127,7 @@ def _handle(self, hass, data):
self.async_see(
gps=gps_location,
mac=mac,
source_type=SOURCE_TYPE_ROUTER,
source_type=SourceType.ROUTER,
gps_accuracy=accuracy,
attributes=attrs,
)
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/mikrotik/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from homeassistant.components.device_tracker.config_entry import ScannerEntity
from homeassistant.components.device_tracker.const import (
DOMAIN as DEVICE_TRACKER,
SOURCE_TYPE_ROUTER,
SourceType,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
Expand Down Expand Up @@ -101,9 +101,9 @@ def is_connected(self) -> bool:
return False

@property
def source_type(self) -> str:
def source_type(self) -> SourceType:
"""Return the source type of the client."""
return SOURCE_TYPE_ROUTER
return SourceType.ROUTER

@property
def hostname(self) -> str:
Expand Down