forked from home-assistant/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add strict typing to device_tracker (home-assistant#50930)
* Add strict typing to device_tracker * Update homeassistant/components/device_tracker/legacy.py Co-authored-by: Martin Hjelmare <[email protected]> Co-authored-by: Martin Hjelmare <[email protected]>
- Loading branch information
1 parent
2e316f6
commit b704f0e
Showing
7 changed files
with
157 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,38 @@ | ||
"""Device tracker constants.""" | ||
from datetime import timedelta | ||
import logging | ||
from typing import Final | ||
|
||
LOGGER = logging.getLogger(__package__) | ||
LOGGER: Final = logging.getLogger(__package__) | ||
|
||
DOMAIN = "device_tracker" | ||
DOMAIN: Final = "device_tracker" | ||
|
||
PLATFORM_TYPE_LEGACY = "legacy" | ||
PLATFORM_TYPE_ENTITY = "entity_platform" | ||
PLATFORM_TYPE_LEGACY: Final = "legacy" | ||
PLATFORM_TYPE_ENTITY: Final = "entity_platform" | ||
|
||
SOURCE_TYPE_GPS = "gps" | ||
SOURCE_TYPE_ROUTER = "router" | ||
SOURCE_TYPE_BLUETOOTH = "bluetooth" | ||
SOURCE_TYPE_BLUETOOTH_LE = "bluetooth_le" | ||
SOURCE_TYPE_GPS: Final = "gps" | ||
SOURCE_TYPE_ROUTER: Final = "router" | ||
SOURCE_TYPE_BLUETOOTH: Final = "bluetooth" | ||
SOURCE_TYPE_BLUETOOTH_LE: Final = "bluetooth_le" | ||
|
||
CONF_SCAN_INTERVAL = "interval_seconds" | ||
SCAN_INTERVAL = timedelta(seconds=12) | ||
CONF_SCAN_INTERVAL: Final = "interval_seconds" | ||
SCAN_INTERVAL: Final = timedelta(seconds=12) | ||
|
||
CONF_TRACK_NEW = "track_new_devices" | ||
DEFAULT_TRACK_NEW = True | ||
CONF_TRACK_NEW: Final = "track_new_devices" | ||
DEFAULT_TRACK_NEW: Final = True | ||
|
||
CONF_CONSIDER_HOME = "consider_home" | ||
DEFAULT_CONSIDER_HOME = timedelta(seconds=180) | ||
CONF_CONSIDER_HOME: Final = "consider_home" | ||
DEFAULT_CONSIDER_HOME: Final = timedelta(seconds=180) | ||
|
||
CONF_NEW_DEVICE_DEFAULTS = "new_device_defaults" | ||
CONF_NEW_DEVICE_DEFAULTS: Final = "new_device_defaults" | ||
|
||
ATTR_ATTRIBUTES = "attributes" | ||
ATTR_BATTERY = "battery" | ||
ATTR_DEV_ID = "dev_id" | ||
ATTR_GPS = "gps" | ||
ATTR_HOST_NAME = "host_name" | ||
ATTR_LOCATION_NAME = "location_name" | ||
ATTR_MAC = "mac" | ||
ATTR_SOURCE_TYPE = "source_type" | ||
ATTR_CONSIDER_HOME = "consider_home" | ||
ATTR_IP = "ip" | ||
ATTR_ATTRIBUTES: Final = "attributes" | ||
ATTR_BATTERY: Final = "battery" | ||
ATTR_DEV_ID: Final = "dev_id" | ||
ATTR_GPS: Final = "gps" | ||
ATTR_HOST_NAME: Final = "host_name" | ||
ATTR_LOCATION_NAME: Final = "location_name" | ||
ATTR_MAC: Final = "mac" | ||
ATTR_SOURCE_TYPE: Final = "source_type" | ||
ATTR_CONSIDER_HOME: Final = "consider_home" | ||
ATTR_IP: Final = "ip" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.