Device tracker component & platform validation. No more home_range. (#2908)

* Device tracker component & platform validation. No more home_range.

* Mock, bluetooth

* Renamed _CONFIG_SCHEMA. Raise warning for #1606

* test duplicates

* Fix assert

* Coverage

* Typing

* T fixes
This commit is contained in:
Johann Kellerman
2016-08-30 18:22:52 +02:00
committed by Teagan Glenn
parent 16e0187fcc
commit 55d305359e
10 changed files with 259 additions and 175 deletions

View File

@ -1,24 +1,13 @@
"""Typing Helpers for Home-Assistant."""
from typing import Dict, Any
from typing import Dict, Any, Tuple
# NOTE: NewType added to typing in 3.5.2 in June, 2016; Since 3.5.2 includes
# security fixes everyone on 3.5 should upgrade "soon"
try:
from typing import NewType
except ImportError:
NewType = None
import homeassistant.core
# pylint: disable=invalid-name
if NewType:
ConfigType = NewType('ConfigType', Dict[str, Any])
# Custom type for recorder Queries
QueryType = NewType('QueryType', Any)
GPSType = Tuple[float, float]
ConfigType = Dict[str, Any]
HomeAssistantType = homeassistant.core.HomeAssistant
# Duplicates for 3.5.1
# pylint: disable=invalid-name
else:
ConfigType = Dict[str, Any] # type: ignore
# Custom type for recorder Queries
QueryType = Any # type: ignore
# Custom type for recorder Queries
QueryType = Any