增加SN字段

This commit is contained in:
不求圣剑
2026-01-23 10:22:51 +08:00
parent c09b005ce0
commit 805af8fafd
4 changed files with 47 additions and 40 deletions

View File

@@ -16,6 +16,8 @@ _LOGGER = logging.getLogger(__name__)
# 配置数据模式
DATA_SCHEMA = vol.Schema(
{
vol.Required("mqtt_host"): str,
vol.Required("device_sn"): str,
vol.Required("token"): str,
vol.Optional(
"topic_prefix",
@@ -45,8 +47,9 @@ class JackeryConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
errors["base"] = "mqtt_not_configured"
else:
_LOGGER.info(
f"Creating Jackery config entry with topic_prefix: "
f"{user_input.get('topic_prefix', 'hb')}"
f"Creating Jackery config entry with mqtt_host: {user_input.get('mqtt_host')}, "
f"device_sn: {user_input.get('device_sn')}, "
f"topic_prefix: {user_input.get('topic_prefix', 'hb')}"
)
return self.async_create_entry(