refactor: 配置迁移至 .env,推送直连设备 MAC

- config.py 顶部新增零依赖 _load_dotenv(),凭证/参数统一从同目录 .env 读取,
  真实环境变量(cron/命令行注入)优先;移除所有明文 fallback
- 新增 .env.example 模板,.env 加入 .gitignore
- pusher.py 删除 get_devices(),resolve_device_id() 直接取 ZECTRIX_DEVICE_ID,
  不再调 GET /devices 列表
- jm_api.py 改为设备密钥授权(client_secret,免验证码),token 进程内缓存 + 401 重试
- 同步 CLAUDE.md / main.py 文档

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-29 15:25:36 +08:00
parent cc11dffb02
commit 3e0e6c73a1
7 changed files with 138 additions and 37 deletions

1
.gitignore vendored
View File

@@ -4,3 +4,4 @@ __pycache__/
.weather_cache.json
.trend_cache.json
run.sh
.env