mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +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 ipaddress import ip_address
|
||||
from types import MappingProxyType
|
||||
from typing import Any
|
||||
from urllib.parse import urlsplit
|
||||
|
||||
@ -88,7 +87,7 @@ class AxisFlowHandler(ConfigFlow, domain=AXIS_DOMAIN):
|
||||
|
||||
if user_input is not None:
|
||||
try:
|
||||
api = await get_axis_api(self.hass, MappingProxyType(user_input))
|
||||
api = await get_axis_api(self.hass, user_input)
|
||||
|
||||
except AuthenticationRequired:
|
||||
errors["base"] = "invalid_auth"
|
||||
|
@ -6,7 +6,6 @@ import asyncio
|
||||
from collections.abc import Mapping
|
||||
import logging
|
||||
import sys
|
||||
from types import MappingProxyType
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
@ -220,7 +219,7 @@ class OllamaOptionsFlow(OptionsFlow):
|
||||
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)
|
||||
return self.async_show_form(
|
||||
step_id="init",
|
||||
|
@ -5,7 +5,6 @@ from __future__ import annotations
|
||||
from collections.abc import Mapping
|
||||
import logging
|
||||
import re
|
||||
from types import MappingProxyType
|
||||
from typing import Any, NamedTuple
|
||||
from urllib.parse import urlsplit
|
||||
|
||||
@ -84,7 +83,7 @@ class HubInfo(NamedTuple):
|
||||
async def _validate_input(hass: HomeAssistant, data: dict[str, Any]) -> HubInfo:
|
||||
"""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()
|
||||
name = await client.get_controller_name()
|
||||
sites = await client.get_sites()
|
||||
|
Loading…
x
Reference in New Issue
Block a user