Add native Python types support to templates (#41227)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Franck Nijhof
2020-10-07 00:05:52 +02:00
committed by GitHub
parent cbb4324c84
commit ee914366a8
29 changed files with 349 additions and 282 deletions

View File

@@ -1427,6 +1427,9 @@ class Config:
# If Home Assistant is running in safe mode
self.safe_mode: bool = False
# Use legacy template behavior
self.legacy_templates: bool = False
def distance(self, lat: float, lon: float) -> Optional[float]:
"""Calculate distance from Home Assistant.