Add scrape to strict-typing ()

pull/86530/head^2
epenet 2023-01-24 14:11:56 +01:00 committed by GitHub
parent a9533c72fc
commit 44beb350cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions
homeassistant/components/scrape

View File

@ -256,6 +256,7 @@ homeassistant.components.ruuvitag_ble.*
homeassistant.components.samsungtv.*
homeassistant.components.scene.*
homeassistant.components.schedule.*
homeassistant.components.scrape.*
homeassistant.components.select.*
homeassistant.components.senseme.*
homeassistant.components.sensibo.*

View File

@ -2,7 +2,7 @@
from __future__ import annotations
from collections.abc import Mapping
from typing import Any
from typing import Any, cast
import uuid
import voluptuous as vol
@ -172,7 +172,7 @@ async def get_edit_sensor_suggested_values(
) -> dict[str, Any]:
"""Return suggested values for sensor editing."""
idx: int = handler.flow_state["_idx"]
return handler.options[SENSOR_DOMAIN][idx]
return cast(dict[str, Any], handler.options[SENSOR_DOMAIN][idx])
async def validate_sensor_edit(
@ -284,4 +284,4 @@ class ScrapeConfigFlowHandler(SchemaConfigFlowHandler, domain=DOMAIN):
def async_config_entry_title(self, options: Mapping[str, Any]) -> str:
"""Return config entry title."""
return options[CONF_RESOURCE]
return cast(str, options[CONF_RESOURCE])

View File

@ -2314,6 +2314,16 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.scrape.*]
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.select.*]
check_untyped_defs = true
disallow_incomplete_defs = true