diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index 71c179035de..f6a541063c5 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -128,7 +128,8 @@ class ConfigEntry: async def async_setup( self, hass: HomeAssistant, *, - integration: Optional[loader.Integration] = None, tries=0) -> None: + integration: Optional[loader.Integration] = None, tries: int = 0) \ + -> None: """Set up an entry.""" if integration is None: integration = await loader.async_get_integration(hass, self.domain) @@ -190,7 +191,9 @@ class ConfigEntry: else: self.state = ENTRY_STATE_SETUP_ERROR - async def async_unload(self, hass, *, integration=None) -> bool: + async def async_unload( + self, hass: HomeAssistant, *, + integration: Optional[loader.Integration] = None) -> bool: """Unload an entry. Returns if unload is possible and was successful. @@ -220,7 +223,8 @@ class ConfigEntry: return False try: - result = await component.async_unload_entry(hass, self) + result = await component.async_unload_entry( # type: ignore + hass, self) assert isinstance(result, bool) diff --git a/mypy.ini b/mypy.ini index da3972ac39b..0732110fd92 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,5 +1,7 @@ [mypy] +python_version = 3.5 check_untyped_defs = true +disallow_incomplete_defs = true disallow_untyped_calls = true follow_imports = silent ignore_missing_imports = true