From 66b86e3b7451f23fb49a22ec566732c6e62e012b Mon Sep 17 00:00:00 2001 From: impressionyang Date: Wed, 15 Apr 2026 18:49:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20config=5Fflow.py=20?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=B3=A8=E8=A7=A3=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 dict[str, any] 改为 dict[str, Any] - 添加 typing.Any 导入 这会导致 500 Internal Server Error Co-Authored-By: Claude Opus 4.6 --- custom_components/sigmesh_gateway/config_flow.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/custom_components/sigmesh_gateway/config_flow.py b/custom_components/sigmesh_gateway/config_flow.py index ebd78e7..26ab0dd 100644 --- a/custom_components/sigmesh_gateway/config_flow.py +++ b/custom_components/sigmesh_gateway/config_flow.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Any + import voluptuous as vol from homeassistant import config_entries from homeassistant.core import callback @@ -22,7 +24,7 @@ class SigMeshGatewayConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): VERSION = 1 async def async_step_user( - self, user_input: dict[str, any] | None = None + self, user_input: dict[str, Any] | None = None ) -> FlowResult: """处理用户配置步骤.""" errors = {} @@ -79,7 +81,7 @@ class SigMeshGatewayOptionsFlow(config_entries.OptionsFlow): """初始化选项流程.""" self.config_entry = config_entry - async def async_step_init(self, user_input: dict[str, any] | None = None) -> FlowResult: + async def async_step_init(self, user_input: dict[str, Any] | None = None) -> FlowResult: """管理选项.""" if user_input is not None: return self.async_create_entry(title="", data=user_input)