3个不稳定版本
0.2.0 | 2023年12月15日 |
---|---|
0.1.1 | 2023年12月13日 |
0.1.0 | 2023年12月12日 |
#577 in HTTP服务器
100KB
2K SLoC
UI
查看Riz UI,了解如何将Web UI与该API集成的示例。
开发
这两个开发工具都旨在快速迭代,但dev.sh
速度更快。
run.sh
- 使用单独的构建和运行Dockerfile,在本地使用Docker启动API
dev.sh
- 不使用Docker启动API(需要安装Rust)
配置
环境变量 | 默认值 | 描述 |
---|---|---|
RIZ_PORT |
8080 | API监听端口 |
RIZ_STORAGE_PATH |
. | 存储路径(rooms.json 必须可由运行UID写入) |
RIZ_CORS_ORIGIN |
https://127.0.0.1:8000 | 允许的CORS源 |
Docker
构建参数 | 默认值 | 描述 |
---|---|---|
UID |
10010 | 运行UID |
默认情况下,RIZ_STORAGE_PATH
配置为/data
;这是一个可以使用的VOLUME挂载。
运行的Dockerfile包括健康检查配置。
CLI
要使用CLI;要么从构建容器中拉取二进制文件,要么使用cargo build --release
在本地上构建此项目。CLI将构建为target/release/riz
。如果您想在任何地方使用riz
,请将其移动到$PATH
中。
$ riz --help
Riz light control CLI
Usage: riz [OPTIONS] [IP]...
Arguments:
[IP]... Bulb IPv4 address(es)
Options:
-b, --brightness <BRIGHTNESS> Set the bulb brightness (10-100)
-c, --color <COLOR> Set the bulb color as r,g,b (0-255)
-C, --cool <COOL> Set the cool white value (1-100)
-W, --warm <WARM> Set the warm white value (1-100)
-p, --speed <SPEED> Set the bulb speed (20-200)
-t, --temp <TEMP> Set the bulb temperature in Kelvin (1000-8000)
-l, --list List the available scene IDs
-s, --scene <SCENE> Set the scene by ID
-o, --on Turn the bulb on
-f, --off Turn the bulb off
-r, --reboot Reboot the bulb
-i, --status Get the current bulb status
-h, --help Print help
-V, --version Print version
依赖关系
~22–35MB
~598K SLoC