mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 19:09:32 +00:00
Add typing to homeassistant/*.py and homeassistant/util/ (#15569)
* Add typing to homeassistant/*.py and homeassistant/util/ * Fix wrong merge * Restore iterable in OrderedSet * Fix tests
This commit is contained in:
@@ -33,7 +33,7 @@ LocationInfo = collections.namedtuple(
|
||||
'use_metric'])
|
||||
|
||||
|
||||
def detect_location_info():
|
||||
def detect_location_info() -> Optional[LocationInfo]:
|
||||
"""Detect location information."""
|
||||
data = _get_freegeoip()
|
||||
|
||||
@@ -63,7 +63,7 @@ def distance(lat1: Optional[float], lon1: Optional[float],
|
||||
return result * 1000
|
||||
|
||||
|
||||
def elevation(latitude, longitude):
|
||||
def elevation(latitude: float, longitude: float) -> int:
|
||||
"""Return elevation for given latitude and longitude."""
|
||||
try:
|
||||
req = requests.get(
|
||||
|
||||
Reference in New Issue
Block a user