Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Refactoring #21

Merged
merged 19 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
af72dab
Make API more idiomatic and don't query devices if not needed
Holzhaus Feb 13, 2024
d00a36c
Use more descriptive `device_type_from_product_id` function name
Holzhaus Feb 14, 2024
e38fcd4
Increase clippy warning level and fix warnings
Holzhaus Feb 14, 2024
f7037cf
Enforce and add documentation of all public library members
Holzhaus Feb 14, 2024
63f0b54
Move serial number filtering to `main.rs`
Holzhaus Feb 14, 2024
42260cd
build: Mark binary-only dependencies as optional
Holzhaus Feb 16, 2024
39bfb10
Expose device info of `Device`
Holzhaus Feb 16, 2024
3f941ef
Rework device serial number filtering code
Holzhaus Feb 16, 2024
a5b67d4
Add `Litra` object to encapsulate the hidapi context
Holzhaus Feb 16, 2024
6e12b4c
Use more efficient `find()` instead of `filter().next()`
Holzhaus Feb 16, 2024
374e8f8
build: Mark `cli` as default feature for easy binary building
Holzhaus Feb 18, 2024
716befe
Merge branch 'main' of github.com:timrogers/litra-rs into api-refactor
Holzhaus Feb 19, 2024
fc87b9e
refactor: Rename "enabled" to "on"
Holzhaus Feb 19, 2024
c054fac
Move range checks into `lib.rs` and improve library error handling
Holzhaus Feb 19, 2024
980b81f
Streamline error handling in `main.rs`
Holzhaus Feb 19, 2024
62d6846
build: Bump versions in `Cargo.lock`
Holzhaus Feb 20, 2024
859bf40
Remove unnecessary import in `lib.rs`
Holzhaus Feb 20, 2024
7af3ec0
ci: Remove `Cargo.lock` from pre-commit GitHub Actions workflow
Holzhaus Feb 20, 2024
c82c69a
Add error handling for brightness calculation errors to `main.rs`
Holzhaus Feb 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ jobs:
with:
fetch-depth: 2

- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
with:
command: generate-lockfile

- name: Set up Python
uses: actions/setup-python@v2

Expand Down
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ keywords = ["logitech", "litra", "glow", "beam", "light"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.5.0", features = ["derive"] }
hidapi = "2.6.0"
serde = { version = "1.0.196", features = ["derive"] }
serde_json = "1.0.113"
clap = { version = "4.5.0", features = ["derive"], optional = true }
serde = { version = "1.0.196", features = ["derive"], optional = true }
serde_json = { version = "1.0.113", optional = true }

[features]
default = ["cli"]
cli = ["dep:clap", "dep:serde", "dep:serde_json"]

[[bin]]
name = "litra"
required-features = ["cli"]
Loading
Loading