Files
xiaomihome/miot/overview.md
T
4566704 3a44cb9e6a feat: 初始化小米 IoT (MIoT) 智能家居 Go 库
- 实现 MIoT 客户端核心功能(MQTT 连接、设备管理、属性读写)
- 支持云端 API 调用与局域网设备发现(mDNS)
- 集成国际化(i18n)多语言支持
- 添加 MIoT 设备规约解析器(spec_parser)
- 包含单元测试与使用示例
2026-06-28 22:05:49 +08:00

24 lines
952 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# BATCH2 任务完成概述
## 完成情况
三个 P1 高级功能移植任务全部完成,编译和 vet 检查通过。
| 任务 | 文件 | 行数 | 状态 |
|------|------|------|------|
| 2.1 | spec_parser.go | ~970 | ✅ done |
| 2.2 | mips_client.go | ~680 | ✅ done |
| 2.3 | miot_network.go | ~490 | ✅ 新建 |
## 关键决策
1. **spec_parser.go**: 采用两阶段下载策略(miot-spec.org 模板列表 + cdn 外部标准库合并),14天本地缓存
2. **mips_client.go**: MQTT 连接抽象为 MQTTClient 接口,paho 适配器预留 stub(待 go get 真实依赖后激活)
3. **miot_network.go**: 网卡信息用 Go 标准库 `net.Interfaces()` 替代 Python psutil,ping 用 exec.Command 跨平台适配
## 后续事项
- mips_client.go 需要 `go get github.com/eclipse/paho.mqtt.golang` 激活真实 MQTT
- spec_parser.go 的云端刷新需要实际网络环境验证
- 所有三个模块需要对应的单元测试