my.location.home: simplify config format, make it a bit more robust + tests

This commit is contained in:
Dima Gerasimov 2020-10-11 19:57:14 +01:00 committed by karlicoss
parent d8ed780e36
commit 4666378f7e
3 changed files with 68 additions and 34 deletions

View file

@ -33,6 +33,12 @@ class bluemaestro:
class google:
takeout_path: Paths = ''
from typing import Sequence, Union, Tuple
from datetime import datetime, date
DateIsh = Union[datetime, date, str]
LatLon = Tuple[float, float]
class location:
class home:
current = (1.0, -1.0)
# todo ugh, need to think about it... mypy wants the type here to be general, otherwise it can't deduce
# and we can't import the types from the module itself, otherwise would be circular. common module?
home: Union[LatLon, Sequence[Tuple[DateIsh, LatLon]]] = (1.0, -1.0)