Upgrade mypy to 0.740 (#27913)

* Upgrade mypy to 0.740

http://mypy-lang.blogspot.com/2019/10/mypy-0740-released.html

* Type hint additions

* Type fixes

* Remove no longer needed type ignores and casts

* Disable untyped definition checks in bunch of files
This commit is contained in:
Ville Skyttä authored and Paulus Schoutsen committed 2019-10-19 11:35:57 -07:00
1 parent 758fcc9b00
commit 381d423fec
17 files changed
+25 -21

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ from homeassistant.helpers.config_validation import ENTITY_SERVICE_SCHEMA
from homeassistant.helpers.typing import HomeAssistantType
# mypy: allow-untyped-calls, allow-untyped-defs
# mypy: allow-untyped-calls, allow-untyped-defs, no-check-untyped-defs
DOMAIN = "group"
+3 -2
View File
@@ -44,6 +44,7 @@ from homeassistant.components.cover import (
# mypy: allow-incomplete-defs, allow-untyped-calls, allow-untyped-defs
# mypy: no-check-untyped-defs
_LOGGER = logging.getLogger(__name__)
@@ -74,7 +75,7 @@ class CoverGroup(CoverDevice):
"""Initialize a CoverGroup entity."""
self._name = name
self._is_closed = False
self._cover_position = 100
self._cover_position: Optional[int] = 100
self._tilt_position = None
self._supported_features = 0
self._assumed_state = True
@@ -178,7 +179,7 @@ class CoverGroup(CoverDevice):
return self._is_closed
@property
def current_cover_position(self):
def current_cover_position(self) -> Optional[int]:
"""Return current position for all covers."""
return self._cover_position
+1
View File
@@ -45,6 +45,7 @@ from homeassistant.components.light import (
# mypy: allow-incomplete-defs, allow-untyped-calls, allow-untyped-defs
# mypy: no-check-untyped-defs
_LOGGER = logging.getLogger(__name__)
+1 -1
View File
@@ -18,7 +18,7 @@ from homeassistant.components.notify import (
)
# mypy: allow-untyped-calls, allow-untyped-defs
# mypy: allow-untyped-calls, allow-untyped-defs, no-check-untyped-defs
_LOGGER = logging.getLogger(__name__)