home-assistant-awtrix

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AWTRIX

AWTRIX

Workflow

工作流程

  • Use the bundled
    awtrix_fs.py
    script for deterministic filesystem operations and LaMetric icon imports.
  • Use absolute device paths (leading
    /
    ) to avoid firmware path errors.
  • Use references for endpoint behavior and MQTT/HA integration patterns.
  • 使用内置的
    awtrix_fs.py
    脚本执行确定性文件系统操作和LaMetric图标导入。
  • 使用绝对设备路径(以
    /
    开头),避免固件路径错误。
  • 参考端点行为以及MQTT/HA集成模式。

Quick start

快速开始

All script and reference files are relative to the location of this SKILL.md file.
bash
python3 scripts/awtrix_fs.py --host <ip> status
python3 scripts/awtrix_fs.py --host <ip> icons list
python3 scripts/awtrix_fs.py --host <ip> icons import-lametric <id>
所有脚本和参考文件的路径均相对于本SKILL.md文件所在位置。
bash
python3 scripts/awtrix_fs.py --host <ip> status
python3 scripts/awtrix_fs.py --host <ip> icons list
python3 scripts/awtrix_fs.py --host <ip> icons import-lametric <id>

Tasks

任务

Import a LaMetric icon by ID

通过ID导入LaMetric图标

  • Run:
    python3 scripts/awtrix_fs.py --host <ip> icons import-lametric <id>
  • Read:
    references/AWTRIX_HTTP_FILESYSTEM.md
    for endpoint details
  • 运行命令:
    python3 scripts/awtrix_fs.py --host <ip> icons import-lametric <id>
  • 阅读
    references/AWTRIX_HTTP_FILESYSTEM.md
    获取端点详情

List icons on the device

列出设备上的图标

  • Run:
    python3 ~/.codex/skills/home-assistant-awtrix/scripts/awtrix_fs.py --host <ip> icons list
  • 运行命令:
    python3 ~/.codex/skills/home-assistant-awtrix/scripts/awtrix_fs.py --host <ip> icons list

Upload / rename / delete files

上传 / 重命名 / 删除文件

  • Upload local file:
    ... upload ./local.jpg /ICONS/9999.jpg
  • Rename:
    ... rename /ICONS/old.gif /ICONS/new.gif
  • Delete:
    ... delete /ICONS/bad.gif
  • 上传本地文件:
    ... upload ./local.jpg /ICONS/9999.jpg
  • 重命名:
    ... rename /ICONS/old.gif /ICONS/new.gif
  • 删除:
    ... delete /ICONS/bad.gif

Delete ALL icons safely (avoid 404 loop bug)

安全删除所有图标(避免404循环漏洞)

When deleting many files returned by
icons list
, avoid command substitution loops that collapse whitespace. Use a line-safe loop so each filename is deleted individually:
bash
python3 scripts/awtrix_fs.py --host <ip> icons list \
  | awk '{print $3}' \
  | while IFS= read -r f; do
      python3 scripts/awtrix_fs.py --host <ip> delete "/ICONS/$f"
    done
当删除
icons list
返回的多个文件时,要避免会折叠空白字符的命令替换循环。使用行安全循环,逐个删除每个文件名:
bash
python3 scripts/awtrix_fs.py --host <ip> icons list \
  | awk '{print $3}' \
  | while IFS= read -r f; do
      python3 scripts/awtrix_fs.py --host <ip> delete "/ICONS/$f"
    done

References

参考资料

  • HTTP endpoints, filesystem API, and LaMetric import details:
    references/AWTRIX_HTTP_FILESYSTEM.md
  • MQTT/HA control patterns (custom apps, notify, settings):
    references/AWTRIX.md
  • Upstream MQTT API reference:
    references/upstream-api.md
  • HTTP端点、文件系统API和LaMetric导入详情:
    references/AWTRIX_HTTP_FILESYSTEM.md
  • MQTT/HA控制模式(自定义应用、通知、设置):
    references/AWTRIX.md
  • 上游MQTT API参考:
    references/upstream-api.md