mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Replace unnecessary MappingProxyType runtime uses in integrations (#143507)
This commit is contained in:
parent
beab4e0d7c
commit
8215faea0d
@ -4,7 +4,6 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from collections.abc import Mapping
|
from collections.abc import Mapping
|
||||||
from ipaddress import ip_address
|
from ipaddress import ip_address
|
||||||
from types import MappingProxyType
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from urllib.parse import urlsplit
|
from urllib.parse import urlsplit
|
||||||
|
|
||||||
@ -88,7 +87,7 @@ class AxisFlowHandler(ConfigFlow, domain=AXIS_DOMAIN):
|
|||||||
|
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
try:
|
try:
|
||||||
api = await get_axis_api(self.hass, MappingProxyType(user_input))
|
api = await get_axis_api(self.hass, user_input)
|
||||||
|
|
||||||
except AuthenticationRequired:
|
except AuthenticationRequired:
|
||||||
errors["base"] = "invalid_auth"
|
errors["base"] = "invalid_auth"
|
||||||
|
@ -6,7 +6,6 @@ import asyncio
|
|||||||
from collections.abc import Mapping
|
from collections.abc import Mapping
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
from types import MappingProxyType
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
@ -220,7 +219,7 @@ class OllamaOptionsFlow(OptionsFlow):
|
|||||||
title=_get_title(self.model), data=user_input
|
title=_get_title(self.model), data=user_input
|
||||||
)
|
)
|
||||||
|
|
||||||
options = self.config_entry.options or MappingProxyType({})
|
options: Mapping[str, Any] = self.config_entry.options or {}
|
||||||
schema = ollama_config_option_schema(self.hass, options)
|
schema = ollama_config_option_schema(self.hass, options)
|
||||||
return self.async_show_form(
|
return self.async_show_form(
|
||||||
step_id="init",
|
step_id="init",
|
||||||
|
@ -5,7 +5,6 @@ from __future__ import annotations
|
|||||||
from collections.abc import Mapping
|
from collections.abc import Mapping
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
from types import MappingProxyType
|
|
||||||
from typing import Any, NamedTuple
|
from typing import Any, NamedTuple
|
||||||
from urllib.parse import urlsplit
|
from urllib.parse import urlsplit
|
||||||
|
|
||||||
@ -84,7 +83,7 @@ class HubInfo(NamedTuple):
|
|||||||
async def _validate_input(hass: HomeAssistant, data: dict[str, Any]) -> HubInfo:
|
async def _validate_input(hass: HomeAssistant, data: dict[str, Any]) -> HubInfo:
|
||||||
"""Validate the user input allows us to connect."""
|
"""Validate the user input allows us to connect."""
|
||||||
|
|
||||||
client = await create_omada_client(hass, MappingProxyType(data))
|
client = await create_omada_client(hass, data)
|
||||||
controller_id = await client.login()
|
controller_id = await client.login()
|
||||||
name = await client.get_controller_name()
|
name = await client.get_controller_name()
|
||||||
sites = await client.get_sites()
|
sites = await client.get_sites()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user