新增米家环境监控模块 (采集/聚合/历史/前端 EnvView) + CI 挂载米家凭证目录并自动应用迁移
Docker Build and Push / build-image (push) Successful in 6m54s

This commit is contained in:
jif2.zhang
2026-09-21 11:42:58 +08:00
parent 53f63e0986
commit 8e2c6ffa35
36 changed files with 11327 additions and 428 deletions
+29
View File
@@ -0,0 +1,29 @@
// 手动跑一次米家采集 (备用): npm run data:mihome
// 带文件日志, 便于定位卡点
import fs from 'node:fs'
const LOG = 'D:\\workbench\\iboard\\server\\mihome\\.cache\\cli.log'
const log = (m) => fs.appendFileSync(LOG, new Date().toISOString() + ' ' + m + '\n')
process.on('uncaughtException', (e) => { log('uncaughtException: ' + (e.stack || e)); process.exit(1) })
process.on('unhandledRejection', (e) => { log('unhandledRejection: ' + (e && e.stack ? e.stack : String(e))); process.exit(1) })
log('start')
const m = await import('../server/mihome/index.js')
log('imported; calling dailyMaintenance')
try {
const r = await m.dailyMaintenance()
log('done: ' + JSON.stringify(r))
console.log('[data:mihome] 完成:', JSON.stringify(r))
} catch (e) {
if (e instanceof m.MihomeAuthError) {
log('auth error: ' + e.message)
console.log('[data:mihome] 米家授权不可用: ' + e.message)
console.log('[data:mihome] 请运行 npm run data:mihome:login 扫码授权')
process.exit(2)
}
log('failed: ' + (e && e.stack ? e.stack : String(e)))
console.error('[data:mihome] 失败:', e.message)
process.exit(1)
}
log('exit(0)')
process.exit(0)