mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Enable strict typing for bthome (#107859)
This commit is contained in:
parent
96a9ebf137
commit
7e28c788cb
@ -110,6 +110,7 @@ homeassistant.components.bond.*
|
|||||||
homeassistant.components.braviatv.*
|
homeassistant.components.braviatv.*
|
||||||
homeassistant.components.brother.*
|
homeassistant.components.brother.*
|
||||||
homeassistant.components.browser.*
|
homeassistant.components.browser.*
|
||||||
|
homeassistant.components.bthome.*
|
||||||
homeassistant.components.button.*
|
homeassistant.components.button.*
|
||||||
homeassistant.components.calendar.*
|
homeassistant.components.calendar.*
|
||||||
homeassistant.components.camera.*
|
homeassistant.components.camera.*
|
||||||
|
@ -75,7 +75,7 @@ class BTHomeConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
errors = {}
|
errors = {}
|
||||||
|
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
bindkey = user_input["bindkey"]
|
bindkey: str = user_input["bindkey"]
|
||||||
|
|
||||||
if len(bindkey) != 32:
|
if len(bindkey) != 32:
|
||||||
errors["bindkey"] = "expected_32_characters"
|
errors["bindkey"] = "expected_32_characters"
|
||||||
@ -173,8 +173,8 @@ class BTHomeConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
# Otherwise there wasn't actually encryption so abort
|
# Otherwise there wasn't actually encryption so abort
|
||||||
return self.async_abort(reason="reauth_successful")
|
return self.async_abort(reason="reauth_successful")
|
||||||
|
|
||||||
def _async_get_or_create_entry(self, bindkey=None):
|
def _async_get_or_create_entry(self, bindkey: str | None = None) -> FlowResult:
|
||||||
data = {}
|
data: dict[str, Any] = {}
|
||||||
if bindkey:
|
if bindkey:
|
||||||
data["bindkey"] = bindkey
|
data["bindkey"] = bindkey
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ async def async_validate_trigger_config(
|
|||||||
hass: HomeAssistant, config: ConfigType
|
hass: HomeAssistant, config: ConfigType
|
||||||
) -> ConfigType:
|
) -> ConfigType:
|
||||||
"""Validate trigger config."""
|
"""Validate trigger config."""
|
||||||
return SCHEMA_BY_EVENT_CLASS.get(config[CONF_TYPE], DEVICE_TRIGGER_BASE_SCHEMA)(
|
return SCHEMA_BY_EVENT_CLASS.get(config[CONF_TYPE], DEVICE_TRIGGER_BASE_SCHEMA)( # type: ignore[no-any-return]
|
||||||
config
|
config
|
||||||
)
|
)
|
||||||
|
|
||||||
|
10
mypy.ini
10
mypy.ini
@ -860,6 +860,16 @@ disallow_untyped_defs = true
|
|||||||
warn_return_any = true
|
warn_return_any = true
|
||||||
warn_unreachable = true
|
warn_unreachable = true
|
||||||
|
|
||||||
|
[mypy-homeassistant.components.bthome.*]
|
||||||
|
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.button.*]
|
[mypy-homeassistant.components.button.*]
|
||||||
check_untyped_defs = true
|
check_untyped_defs = true
|
||||||
disallow_incomplete_defs = true
|
disallow_incomplete_defs = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user