mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Add scrape to strict-typing (#86515)
This commit is contained in:
parent
a9533c72fc
commit
44beb350cd
@ -256,6 +256,7 @@ homeassistant.components.ruuvitag_ble.*
|
|||||||
homeassistant.components.samsungtv.*
|
homeassistant.components.samsungtv.*
|
||||||
homeassistant.components.scene.*
|
homeassistant.components.scene.*
|
||||||
homeassistant.components.schedule.*
|
homeassistant.components.schedule.*
|
||||||
|
homeassistant.components.scrape.*
|
||||||
homeassistant.components.select.*
|
homeassistant.components.select.*
|
||||||
homeassistant.components.senseme.*
|
homeassistant.components.senseme.*
|
||||||
homeassistant.components.sensibo.*
|
homeassistant.components.sensibo.*
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Mapping
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any, cast
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
@ -172,7 +172,7 @@ async def get_edit_sensor_suggested_values(
|
|||||||
) -> dict[str, Any]:
|
) -> dict[str, Any]:
|
||||||
"""Return suggested values for sensor editing."""
|
"""Return suggested values for sensor editing."""
|
||||||
idx: int = handler.flow_state["_idx"]
|
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(
|
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:
|
def async_config_entry_title(self, options: Mapping[str, Any]) -> str:
|
||||||
"""Return config entry title."""
|
"""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_return_any = true
|
||||||
warn_unreachable = 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.*]
|
[mypy-homeassistant.components.select.*]
|
||||||
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