Fix mypy issues in zha config_flow (#73744)

This commit is contained in:
epenet 2022-06-20 16:25:24 +02:00 committed by GitHub
parent 81e3ed790d
commit be2aa44559
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 6 deletions

View file

@ -168,11 +168,10 @@ class ZhaFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
radio_type = discovery_info.properties.get("radio_type") or local_name radio_type = discovery_info.properties.get("radio_type") or local_name
node_name = local_name[: -len(".local")] node_name = local_name[: -len(".local")]
host = discovery_info.host host = discovery_info.host
port = discovery_info.port
if local_name.startswith("tube") or "efr32" in local_name: if local_name.startswith("tube") or "efr32" in local_name:
# This is hard coded to work with legacy devices # This is hard coded to work with legacy devices
port = 6638 port = 6638
else:
port = discovery_info.port
device_path = f"socket://{host}:{port}" device_path = f"socket://{host}:{port}"
if current_entry := await self.async_set_unique_id(node_name): if current_entry := await self.async_set_unique_id(node_name):

View file

@ -2997,9 +2997,6 @@ ignore_errors = true
[mypy-homeassistant.components.zha.climate] [mypy-homeassistant.components.zha.climate]
ignore_errors = true ignore_errors = true
[mypy-homeassistant.components.zha.config_flow]
ignore_errors = true
[mypy-homeassistant.components.zha.core.channels.base] [mypy-homeassistant.components.zha.core.channels.base]
ignore_errors = true ignore_errors = true

View file

@ -148,7 +148,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.zha.binary_sensor", "homeassistant.components.zha.binary_sensor",
"homeassistant.components.zha.button", "homeassistant.components.zha.button",
"homeassistant.components.zha.climate", "homeassistant.components.zha.climate",
"homeassistant.components.zha.config_flow",
"homeassistant.components.zha.core.channels.base", "homeassistant.components.zha.core.channels.base",
"homeassistant.components.zha.core.channels.closures", "homeassistant.components.zha.core.channels.closures",
"homeassistant.components.zha.core.channels.general", "homeassistant.components.zha.core.channels.general",