Add scrape to strict-typing (#86515)
parent
a9533c72fc
commit
44beb350cd
|
@ -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.*
|
||||
|
|
|
@ -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])
|
||||
|
|
10
mypy.ini
10
mypy.ini
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue