feat: 初始化小米 IoT (MIoT) 智能家居 Go 库
- 实现 MIoT 客户端核心功能(MQTT 连接、设备管理、属性读写) - 支持云端 API 调用与局域网设备发现(mDNS) - 集成国际化(i18n)多语言支持 - 添加 MIoT 设备规约解析器(spec_parser) - 包含单元测试与使用示例
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
# R2-07 — miot_client: auth/cert 定时刷新
|
||||
|
||||
## 缺失方法
|
||||
|
||||
Python 有两个定时刷新方法:
|
||||
|
||||
```python
|
||||
def __request_refresh_auth_info(self, delay_sec: int) -> None:
|
||||
"""定时刷新 OAuth token"""
|
||||
def __request_refresh_user_cert(self, delay_sec: int) -> None:
|
||||
"""定时刷新用户证书"""
|
||||
```
|
||||
|
||||
## 目标文件
|
||||
|
||||
`D:\miot\go-miot\miot_client.go`
|
||||
|
||||
添加两个定时器方法,使用 `time.AfterFunc` 延迟执行 Token 和证书刷新。
|
||||
|
||||
### R2-08 — miot_client: 通知方法
|
||||
|
||||
三个通知方法:
|
||||
```python
|
||||
__show_client_error_notify(title, message)
|
||||
__show_devices_changed_notify()
|
||||
__show_central_state_changed_notify(connected)
|
||||
```
|
||||
|
||||
在 `MIoTClient` 上添加对应方法,通过 `persistent_notify` 回调实现通知。
|
||||
Reference in New Issue
Block a user