move home to fallback/via_home.py

This commit is contained in:
Sean Breckenridge 2023-01-27 10:52:24 -08:00
parent 54e6fe6ab5
commit 3638964e98
3 changed files with 6 additions and 1 deletions

View file

@ -1,5 +1,6 @@
from datetime import date, datetime
from typing import Union, Tuple, NamedTuple, Optional
from dataclasses import dataclass
from my.core import __NOT_HPI_MODULE__
@ -9,9 +10,12 @@ LatLon = Tuple[float, float]
# TODO: add timezone to this? can use timezonefinder in tz provider instead though
@dataclass
class Location(NamedTuple):
lat: float
lon: float
dt: datetime
accuracy: Optional[float]
elevation: Optional[float]
datasource: Optional[str] = None # which module provided this, useful for debugging

View file

View file

@ -1,6 +1,7 @@
'''
Simple location provider, serving as a fallback when more detailed data isn't available
'''
from dataclasses import dataclass
from datetime import datetime, time, timezone
from functools import lru_cache
@ -51,7 +52,7 @@ class Config(user_config):
return res
from ..core.cfg import make_config
from ...core.cfg import make_config
config = make_config(Config)