Crates.io | busylight |
lib.rs | busylight |
version | 0.1.0 |
source | src |
created_at | 2019-08-18 14:59:22.922453 |
updated_at | 2019-08-18 14:59:22.922453 |
description | A package for basic control of busylights connected to the system. |
homepage | |
repository | https://gitlab.com/Crowdedlight/busylight.rs |
max_upload_size | |
id | 157874 |
size | 19,846 |
This is a library to control a connected busylight.
There is examples in the example
folder. A basic example of creating an object,
setting it to a colour and ringing with a tone is shown below.
extern crate busylight;
use busylight::{BusyLight};
fn main() {
let mut bl = BusyLight::new();
bl.light("red");
bl.ring(Tones::TelephoneNordic, 6);
}
By default the busylight will turn off when there has been no data sent for 30 seconds. To keep the busylight on with the last value set, enable keepalive by:
bl.keepalive_enable()
This automatically sends current settings to the busylight every 20seconds. To turn off the keepalive use the function:
bl.keepalive_disable()
To make the busylight light a specific color just use a valid css color.
bl.light('orange')
To turn it off
bl.stop_light();
Make the busylight play a ringtone. All the available tones are defined in a enum and can be
access through the Tones
enum.
Volumesteps: The busylight accepts volume values of 0-7
bl.ring(Tones::TelephoneNordic, 4)
To turn it off
bl.stop_ring()
Ringtones (All available through the enum)