Giter VIP home page Giter VIP logo

riz's Introduction

Riz

Rust API (and CLI) for controlling Wiz lights

crate-badge docs-badge min-rust lic-badge
ci-badge downloads-badge docker-badge size-badge
sec-badge dep-badge codecov

UI

Check out Riz UI for an example of integrating a web UI with this API.

Dev

Both dev utilities are designed to be quick to iterate with, but dev.sh is faster.

run.sh

  • Use the separate build & run dockerfiles to start the API with Docker locally

dev.sh

  • Start the API without docker (requires Rust installed)

Config

Env Var Default Description
RIZ_PORT 8080 API listening port
RIZ_STORAGE_PATH . Path to storage (rooms.json must be writable by running UID)
RIZ_CORS_ORIGIN http://localhost:8000 Allowed CORS origin

Docker

Build Arg Default Description
UID 10010 Running UID

By default, RIZ_STORAGE_PATH is configured to /data; which is a VOLUME mount you may use.

The running dockerfiles include a healthcheck configuration.

CLI

To use the CLI; either pull the binary from the build container, or build this project locally with cargo build --release. The CLI will built as target/release/riz. Move that into your $PATH somewhere if you want to use riz anywhere.

$ 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

riz's People

Contributors

a-tal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

riz's Issues

limit allowed light IP addresses

the API should reject:

  • creating a Light with a known IP address
  • updating a Light to a known IP address
  • any IP addresses not valid for the local subnet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.