# buddykang/dorm-laundry-status architecture

> Architecture diagram of the GitHub repository buddykang/dorm-laundry-status, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/buddykang/dorm-laundry-status
- Repository: https://github.com/buddykang/dorm-laundry-status

## Overview

这是一个单文件命令行脚本，用 Playwright 查询设备二维码页面并输出设备状态。主要流程是：用户选择单次或循环检查及输出格式，脚本并发访问配置的设备页面，依据最终 URL 和可见文本分类状态，再格式化输出。README 还说明了设备配置、四种状态和最短轮询间隔；这些能力均由同一文件承载。

Main entry points: [`laundry_status.py`](https://github.com/buddykang/dorm-laundry-status/blob/main/laundry_status.py) (并发页面检查)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["检查与输出"]
  node_cli["命令参数与循环<br/>[laundry_status.py]"]
  node_inventory["设备配置<br/>[laundry_status.py]"]
  node_browser_check["并发页面检查<br/>[laundry_status.py]"]
  node_formatter["文本或 JSON 输出<br/>[laundry_status.py]"]
end

subgraph group_classification["状态识别"]
  node_url_extract["URL 状态提取<br/>[laundry_status.py]"]
  node_classify["状态分类<br/>[laundry_status.py]"]
end

node_user(("命令行用户"))
node_playwright["Playwright Chromium"]
node_platform["设备状态页面"]

node_user -->|"选择检查模式"| node_cli
node_cli -->|"读取设备配置"| node_inventory
node_cli -->|"启动检查"| node_browser_check
node_browser_check -->|"调用浏览器"| node_playwright
node_playwright -->|"打开设备页"| node_platform
node_playwright -->|"返回页面内容"| node_browser_check
node_browser_check -->|"传入最终 URL"| node_url_extract
node_browser_check -->|"传入页面文字"| node_classify
node_url_extract -->|"提供 URL 消息"| node_classify
node_classify -->|"返回状态结果"| node_browser_check
node_browser_check -->|"提交设备结果"| node_formatter
node_cli -->|"选择输出格式"| node_formatter
node_formatter -->|"显示检查结果"| node_user

click node_cli "https://github.com/buddykang/dorm-laundry-status/blob/main/laundry_status.py"
click node_inventory "https://github.com/buddykang/dorm-laundry-status/blob/main/laundry_status.py"
click node_browser_check "https://github.com/buddykang/dorm-laundry-status/blob/main/laundry_status.py"
click node_url_extract "https://github.com/buddykang/dorm-laundry-status/blob/main/laundry_status.py"
click node_classify "https://github.com/buddykang/dorm-laundry-status/blob/main/laundry_status.py"
click node_formatter "https://github.com/buddykang/dorm-laundry-status/blob/main/laundry_status.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_inventory,node_browser_check,node_formatter toneBlue
class node_url_extract,node_classify toneAmber
class node_user,node_playwright,node_platform toneIndigo
```

## Components

### 检查与输出

- [命令参数与循环](https://github.com/buddykang/dorm-laundry-status/blob/main/laundry_status.py): `laundry_status.py`
- [设备配置](https://github.com/buddykang/dorm-laundry-status/blob/main/laundry_status.py): `laundry_status.py`
- [并发页面检查](https://github.com/buddykang/dorm-laundry-status/blob/main/laundry_status.py): `laundry_status.py`
- [文本或 JSON 输出](https://github.com/buddykang/dorm-laundry-status/blob/main/laundry_status.py): `laundry_status.py`

### 状态识别

- [URL 状态提取](https://github.com/buddykang/dorm-laundry-status/blob/main/laundry_status.py): `laundry_status.py`
- [状态分类](https://github.com/buddykang/dorm-laundry-status/blob/main/laundry_status.py): `laundry_status.py`

### Other components

- **命令行用户**
- **Playwright Chromium**
- **设备状态页面**

## Connections

- 命令行用户 → 命令参数与循环: 选择检查模式
- 命令参数与循环 → 设备配置: 读取设备配置
- 命令参数与循环 → 并发页面检查: 启动检查
- 并发页面检查 → Playwright Chromium: 调用浏览器
- Playwright Chromium → 设备状态页面: 打开设备页
- Playwright Chromium → 并发页面检查: 返回页面内容
- 并发页面检查 → URL 状态提取: 传入最终 URL
- 并发页面检查 → 状态分类: 传入页面文字
- URL 状态提取 → 状态分类: 提供 URL 消息
- 状态分类 → 并发页面检查: 返回状态结果
- 并发页面检查 → 文本或 JSON 输出: 提交设备结果
- 命令参数与循环 → 文本或 JSON 输出: 选择输出格式
- 文本或 JSON 输出 → 命令行用户: 显示检查结果
