mirror of https://github.com/home-assistant/core
Mark humidifier entity component as strictly typed (#106721)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
This commit is contained in:
parent
d2a03a4706
commit
06fa306821
|
@ -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.*
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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]
|
||||
|
|
10
mypy.ini
10
mypy.ini
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue