Use PEP 526 type annotations, add some type hints (#26464)

* Add some more type hints to helpers.event

* Change most type comments to variable types

* Remove some superfluous type hints
This commit is contained in:
Ville Skyttä 2019-09-07 09:48:58 +03:00 committed by GitHub
parent 5b3004c7b0
commit 33e1b44b3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 152 additions and 174 deletions

View file

@ -256,7 +256,7 @@ def get_next_departure(
_LOGGER.debug("Timetable: %s", sorted(timetable.keys()))
item = {} # type: dict
item = {}
for key in sorted(timetable.keys()):
if dt_util.parse_datetime(key) > now:
item = timetable[key]
@ -393,11 +393,11 @@ class GTFSDepartureSensor(Entity):
self._available = False
self._icon = ICON
self._name = ""
self._state = None # type: Optional[str]
self._attributes = {} # type: dict
self._state: Optional[str] = None
self._attributes = {}
self._agency = None
self._departure = {} # type: dict
self._departure = {}
self._destination = None
self._origin = None
self._route = None