1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

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
35 changed files with 152 additions and 174 deletions

View File

@@ -19,9 +19,9 @@ class EsphomeFlowHandler(config_entries.ConfigFlow):
def __init__(self):
"""Initialize flow."""
self._host = None # type: Optional[str]
self._port = None # type: Optional[int]
self._password = None # type: Optional[str]
self._host: Optional[str] = None
self._port: Optional[int] = None
self._password: Optional[str] = None
async def async_step_user(
self, user_input: Optional[ConfigType] = None, error: Optional[str] = None
@@ -94,9 +94,7 @@ class EsphomeFlowHandler(config_entries.ConfigFlow):
already_configured = True
elif entry.entry_id in self.hass.data.get(DATA_KEY, {}):
# Does a config entry with this name already exist?
data = self.hass.data[DATA_KEY][
entry.entry_id
] # type: RuntimeEntryData
data: RuntimeEntryData = self.hass.data[DATA_KEY][entry.entry_id]
# Node names are unique in the network
if data.device_info is not None:
already_configured = data.device_info.name == node_name