feat: household TV companion with scoped pairing and direct LAN camera strip

This commit is contained in:
Codex
2026-10-16 00:35:17 +08:00
parent fb87ae4de9
commit 6aa20391b2
42 changed files with 1153 additions and 33 deletions
+6
View File
@@ -0,0 +1,6 @@
import test from 'node:test'
import assert from 'node:assert/strict'
import {chinaParts,weatherLabel} from './frontend/src/tv/time.mjs'
test('Beijing midnight and Thursday ISO week',()=>{const v=chinaParts(new Date('2026-10-14T16:00:00Z'));assert.equal(v.date,'2026-10-15');assert.equal(v.hour,'00');assert.equal(v.weekday,'星期四');assert.equal(v.week,42)})
test('ISO week year across January boundary',()=>{const v=chinaParts(new Date('2021-01-01T00:00:00Z'));assert.equal(v.week,53);assert.equal(v.weekYear,2020)})
test('weather types',()=>{assert.equal(weatherLabel(0),'晴');assert.equal(weatherLabel(95),'雷雨');assert.equal(weatherLabel(65),'有雨')})