Type hint additions (#26831)

* Type hint additions

* Remove optional from sidebar_icon comment

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Remove optional from sidebar_title comment

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Fix issues after rebase and mypy 0.730
This commit is contained in:
Ville Skyttä 2019-09-29 20:07:49 +03:00 committed by GitHub
parent 4f55235aa2
commit f259ff17d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 184 additions and 68 deletions

View file

@ -170,7 +170,7 @@ class FlowHandler:
# Set by flow manager
flow_id: Optional[str] = None
hass: Optional[HomeAssistant] = None
handler = None
handler: Optional[Hashable] = None
cur_step: Optional[Dict[str, str]] = None
context: Dict
@ -188,7 +188,7 @@ class FlowHandler:
data_schema: vol.Schema = None,
errors: Optional[Dict] = None,
description_placeholders: Optional[Dict] = None,
) -> Dict:
) -> Dict[str, Any]:
"""Return the definition of a form to gather user input."""
return {
"type": RESULT_TYPE_FORM,
@ -208,7 +208,7 @@ class FlowHandler:
data: Dict,
description: Optional[str] = None,
description_placeholders: Optional[Dict] = None,
) -> Dict:
) -> Dict[str, Any]:
"""Finish config flow and create a config entry."""
return {
"version": self.VERSION,
@ -224,7 +224,7 @@ class FlowHandler:
@callback
def async_abort(
self, *, reason: str, description_placeholders: Optional[Dict] = None
) -> Dict:
) -> Dict[str, Any]:
"""Abort the config flow."""
return {
"type": RESULT_TYPE_ABORT,
@ -237,7 +237,7 @@ class FlowHandler:
@callback
def async_external_step(
self, *, step_id: str, url: str, description_placeholders: Optional[Dict] = None
) -> Dict:
) -> Dict[str, Any]:
"""Return the definition of an external step for the user to take."""
return {
"type": RESULT_TYPE_EXTERNAL_STEP,
@ -249,7 +249,7 @@ class FlowHandler:
}
@callback
def async_external_step_done(self, *, next_step_id: str) -> Dict:
def async_external_step_done(self, *, next_step_id: str) -> Dict[str, Any]:
"""Return the definition of an external step for the user to take."""
return {
"type": RESULT_TYPE_EXTERNAL_STEP_DONE,