https://github.com/ssnover/borealis
Crate for controlling Nanoleaf Aurora light panels.
https://github.com/ssnover/borealis
iot nanoleaf-aurora
Last synced: 2 months ago
JSON representation
Crate for controlling Nanoleaf Aurora light panels.
- Host: GitHub
- URL: https://github.com/ssnover/borealis
- Owner: ssnover
- Created: 2020-05-09T15:44:09.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-18T14:45:09.000Z (almost 3 years ago)
- Last Synced: 2025-03-05T23:34:07.732Z (3 months ago)
- Topics: iot, nanoleaf-aurora
- Language: Rust
- Homepage:
- Size: 69.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# borealis
Borealis is a thin interface for interacting with the Nanoleaf Aurora in order
to control your light panels programmatically from Rust. A binary `borealis-query`
is provided which queries for the IP address of the panels on your local network,
communicates with the Aurora gateway to create a new authorization token for using
the API, and stores the resulting data in a configuration file for reading the
configuration out for using the library client later.```rust
use borealis::Aurora;
use std::env;
use std::net::Ipv4Addr;#[tokio::main]
pub async fn main() {
let effect_name: String = env::args()
.skip(1)
.next()
.expect("Must specify effect name to display.");let aurora = Aurora::new(
Ipv4Addr::new(192, 168, 1, 12), // IP Address
None, // Port
&"YourAuthTokenHere".to_string(), // Auth Token
);tokio::spawn(async move {
println!("Setting Aurora to display {}", effect_name);
aurora.turn_on().await.unwrap();
aurora.set_effect(&effect_name).await.unwrap();
})
.await
.unwrap();
}
```