Replace unnecessary MappingProxyType runtime uses in integrations (#143507)

This commit is contained in:
Marc Mueller 2025-04-23 12:22:12 +02:00 committed by GitHub
parent beab4e0d7c
commit 8215faea0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 6 deletions

View File

@ -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"

View File

@ -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",

View File

@ -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()