Mark humidifier entity component as strictly typed (#106721)

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
This commit is contained in:
Franck Nijhof 2024-01-02 13:29:07 +01:00 committed by GitHub
parent d2a03a4706
commit 06fa306821
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 4 deletions

View File

@ -202,6 +202,7 @@ homeassistant.components.homekit_controller.utils
homeassistant.components.homewizard.*
homeassistant.components.http.*
homeassistant.components.huawei_lte.*
homeassistant.components.humidifier.*
homeassistant.components.hydrawise.*
homeassistant.components.hyperion.*
homeassistant.components.ibeacon.*

View File

@ -91,7 +91,7 @@ __dir__ = partial(dir_with_deprecated_constants, module_globals=globals())
@bind_hass
def is_on(hass, entity_id):
def is_on(hass: HomeAssistant, entity_id: str) -> bool:
"""Return if the humidifier is on based on the statemachine.
Async friendly.

View File

@ -32,10 +32,9 @@ async def _async_reproduce_states(
_LOGGER.warning("Unable to find entity %s", state.entity_id)
return
async def call_service(service: str, keys: Iterable, data=None):
async def call_service(service: str, keys: Iterable[str]) -> None:
"""Call service with set of attributes given."""
data = data or {}
data["entity_id"] = state.entity_id
data = {"entity_id": state.entity_id}
for key in keys:
if key in state.attributes:
data[key] = state.attributes[key]

View File

@ -1781,6 +1781,16 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.humidifier.*]
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.hydrawise.*]
check_untyped_defs = true
disallow_incomplete_defs = true