Postponed evaluation of annotations for integrations (#46455)

This commit is contained in:
Franck Nijhof 2021-02-12 18:54:00 +01:00 committed by GitHub
parent 061d9c5293
commit dd8d4471ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 54 additions and 22 deletions

View file

@ -1,4 +1,6 @@
"""Support for Timers."""
from __future__ import annotations
from datetime import datetime, timedelta
import logging
from typing import Dict, Optional
@ -198,7 +200,7 @@ class Timer(RestoreEntity):
self._listener = None
@classmethod
def from_yaml(cls, config: Dict) -> "Timer":
def from_yaml(cls, config: Dict) -> Timer:
"""Return entity instance initialized from yaml storage."""
timer = cls(config)
timer.entity_id = ENTITY_ID_FORMAT.format(config[CONF_ID])