Skip to content

feat: 增加摄像头定时感知#308

Open
GodD6366 wants to merge 2 commits into
XiaoMi:mainfrom
GodD6366:codex/camera-sensing-schedule
Open

feat: 增加摄像头定时感知#308
GodD6366 wants to merge 2 commits into
XiaoMi:mainfrom
GodD6366:codex/camera-sensing-schedule

Conversation

@GodD6366

@GodD6366 GodD6366 commented Jun 21, 2026

Copy link
Copy Markdown

概要

  • 新增按摄像头配置的定时感知规则,并持久化到 KV。
  • 支持周一到周日选择生效日期,未配置星期的历史规则默认每天生效。
  • 定时规则只作为运行时感知门控,原有摄像头开关仍是总开关。
  • 新增 Web 配置入口和 CLI 命令,用于查看、设置、关闭摄像头定时感知。

行为说明

  • in_use 表示用户手动总开关,不会被定时配置改写。
  • effective_in_use = in_use && !schedule_paused,只有总开关开启时定时规则才会生效。
  • weekdays 使用 0=周一6=周日;缺省时等价周一到周日全选。
  • 跨午夜时间段按自然日判断,例如只选周一的 22:00-07:00 不覆盖周二凌晨。
  • 关闭定时开关会保留已配置时间段和星期,方便后续重新开启。
  • 定时暂停只影响感知投喂,不影响 watch/live 实时观看。

验证

  • cd backend/miloco && uv run pytest tests/test_miot_filter_and_cameras.py tests/perception/test_camera_adapter_reconnect.py
  • cd cli && uv run pytest tests/test_commands.py
  • cd web && CI=true pnpm typecheck
  • cd web && CI=true pnpm test -- --run
  • python3 -m compileall backend/miloco/src/miloco/miot backend/miloco/src/miloco/perception/collect cli/src/miloco_cli/commands

@CLAassistant

CLAassistant commented Jun 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown

👋 感谢提交 PR @GodD6366!维护者会尽快 review。

提交前请确认:

  • CI 全绿(test / lint / build)
  • 改动聚焦单一主题,便于审阅
  • 若改动了依赖(lockfile / pyproject.toml / package.json),需维护者评论 /allow-dependencies-change <当前 head SHA> 放行(之后再 push 需重新放行)

@GodD6366 GodD6366 changed the title feat: add camera sensing schedules feat: 增加摄像头定时感知 Jun 21, 2026
for did, schedule in value.items()
if isinstance(schedule, dict)
}
except json.JSONDecodeError:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants