M5-T09: add exposed_entities table and ExposableEntity provider framework

This commit is contained in:
tliu93 committed 2026-06-22 14:50:40 +02:00
1 parent 14b846549e
commit 360cddc05b
8 files changed
+1114 -5

No files matched your search

+1 -1
View File
@@ -399,7 +399,7 @@ Phase C(MQTT / Discovery,依赖 B 的设备数据与 provider 接口)
- **Reviewer checklist**: secret 不回显/不入 OpenAPI 示例;`_settings_payload` 未漏字段(否则运行期 override 丢失)。
### M5-T09 — `exposed_entities` 表 + ExposableEntity/provider 框架 `[schema]`
- **Status**: `todo` · **Depends**: M5-T02
- **Status**: `done` · **Depends**: M5-T02
- **Context**: 建"可暴露实体目录"的抽象与开关存储;modbus provider 把设备映射成 device/entities,**实体元数据从 profile 派生**。
- **Files**: `create app/integrations/expose.py`(`ExposableEntity`、provider 协议、注册表、modbus provider);`create app/models/expose.py`(`ExposedEntityToggle`:`key` unique + `enabled` + `updated_at`);`create alembic_app/versions/<date>_08_exposed_entities.py`;`modify alembic_app/env.py`、`scripts/app_db_adopt.py`;`create tests/test_expose_catalog.py`
- **Steps**: