Skip to content

Commit b3465bd

Browse files
authored
Merge pull request #2 from ChickenStorm/develop
v0.2.1
2 parents 131bd8b + 0136693 commit b3465bd

File tree

22 files changed

+607
-154
lines changed

22 files changed

+607
-154
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ updates:
55
schedule:
66
interval: daily
77
open-pull-requests-limit: 10
8-
target-branch: develop
8+
target-branch: main

.github/workflows/fmt.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
- name: Checkout repository
1919
uses: actions/checkout@v2
2020

21-
- name: Install Rust stable toolchain
21+
- name: Install Rust nightly toolchain
2222
uses: actions-rs/toolchain@v1
2323
with:
24-
toolchain: stable
24+
toolchain: nightly
2525
components: rustfmt,
2626

2727
- name: fmt
28-
run: cargo fmt --all -- --check
28+
run: cargo +nightly fmt --all -- --check

.github/workflows/rust_doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Rust-Doc
22

33
on:
44
push:
5-
branches: [ main, develop ]
5+
branches: [ main ]
66

77
env:
88
CARGO_TERM_COLOR: always

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "roccat-vulcan-api-rs"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
authors = ["ChickenStorm <[email protected]>"]
55
edition = "2018"
66
readme = "README.md"

README.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1+
2+
13
# roccat-vulcan-api-rs
4+
5+
![license](https://img.shields.io/github/license/ChickenStorm/roccat-vulcan-api-rs)
6+
[![](https://img.shields.io/badge/doc-Read_Me-blue)](https://chickenstorm.github.io/roccat-vulcan-api-rs/roccat_vulcan_api_rs/index.html)
7+
![Build](https://img.shields.io/github/workflow/status/ChickenStorm/roccat-vulcan-api-rs/Rust)
8+
[![codecov](https://codecov.io/gh/ChickenStorm/roccat-vulcan-api-rs/branch/main/graph/badge.svg?token=Z1J8KMKLC1)](https://codecov.io/gh/ChickenStorm/roccat-vulcan-api-rs)
9+
210
**Roccat Vulcan keyboard illumination API.**
311
A fast multiplatform API to control Roccat Vulcan illumination.
412

@@ -7,32 +15,29 @@ Provide an API to control the lighting of the Roccat Vulcan 100 and 120.
715
# Usage
816

917
add on your dependencies of Cargo.toml
10-
`roccat-vulcan-api-rs = { version = "0.1.1", git = "https://github.com/ChickenStorm/roccat-vulcan-api-rs", branch = "main" }`.
18+
`roccat-vulcan-api-rs = { version = "0.2.1", git = "https://github.com/ChickenStorm/roccat-vulcan-api-rs", branch = "main" }`.
1119

12-
13-
The main way to interact with the API is through `KeyboardApi`.
20+
The main way to interact with the API is through [`KeyboardApi`].
1421
Note that when the structure is dropped the keyboard will go back to the default rainbow behavior.
1522

1623

1724
# Layout
18-
For the moment only Swiss French layout is supported. To support other layout implement the trait `Layout`.
25+
For the moment only Swiss French layout is supported. To support other layout implement the trait [`Layout`].
1926

2027
# Examples
2128
To load and initialized a keyboard use
2229
```rust
23-
use roccat_vulcan_api_rs::{KeyboardApi, config, ColorBuffer, ColorRgb};
24-
use std::{
25-
thread::sleep,
26-
time::Duration,
27-
};
28-
29-
let keyboard = KeyboardApi::get_api().unwrap();
30-
let buffer = ColorBuffer::new(ColorRgb::new(255, 255, 255));
31-
keyboard.render(&buffer).unwrap();
30+
use std::{thread::sleep, time::Duration};
31+
use roccat_vulcan_api_rs::{ColorBuffer, ColorRgb, ErrorRoccatVulcanApi, KeyboardApi};
32+
33+
# fn main() -> Result<(), ErrorRoccatVulcanApi> {
34+
# #[cfg(not(feature = "no-keyboard-test"))]
35+
# {
36+
let keyboard = KeyboardApi::new()?;
37+
let buffer = ColorBuffer::from_element(ColorRgb::new(255, 255, 255));
38+
keyboard.render(&buffer)?;
3239
sleep(Duration::from_secs(1));
40+
# }
41+
# Ok(())
42+
# }
3343
```
34-
35-
### Acknowledgement
36-
37-
- I thank [simonhuwiler](https://github.com/simonhuwiler/roccatvulcan) and [duncanthrax](https://github.com/duncanthrax/roccat-vulcan) for their code which this library is based on.
38-
- And a big thank you to Bidoubioche for helping me learn rust and for always answering my question and the help figuring my way through the compiler messages

examples/render_loop.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
use std::time::Duration;
2+
13
use roccat_vulcan_api_rs::{
24
ColorBuffer, ColorRgb, ErrorRoccatVulcanApi, KeyName, KeyboardApi, Layout, LayoutFrCh,
35
NUMBER_KEY_LED_BUFFER,
46
};
5-
use std::time::Duration;
67

78
fn main() -> Result<(), ErrorRoccatVulcanApi> {
89
let mut key_press_mask: [bool; NUMBER_KEY_LED_BUFFER] = [false; NUMBER_KEY_LED_BUFFER];

rustfmt.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
format_code_in_doc_comments = true
2+
group_imports = "StdExternalCrate"
3+
unstable_features = true
4+
use_field_init_shorthand = true

src/color.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Contains the color and [`ColorBuffer`]
2+
13
mod base;
24
pub use base::*;
35

0 commit comments

Comments
 (0)