Closed Holzhaus closed 3 weeks ago
No plans for merging this?
@mbwilding Happy to if it is marked as ready.
@Holzhaus Is there more to do?
Nope, but the selection is kind of unreliable on my system. Using the serial number or something like that would be better.
The pull request introduces modifications to the Cargo.toml
and src/main.rs
files of the litra
package. The Cargo.toml
file updates the clap
dependency to include a new "env"
feature and adds a new optional dependency, v4l
. In src/main.rs
, enhancements to the command-line interface include the introduction of environment variable options for the serial_number
argument and a new video_device_bus
argument for the AutoToggle
command. Additionally, error handling is improved, and a new error variant is added.
File | Change Summary |
---|---|
Cargo.toml | - Updated clap dependency to include "env" feature. - Added new optional dependency v4l . - Updated cli feature to include v4l . |
src/main.rs | - Added environment variable option for serial_number in multiple commands. - Introduced video_device_bus argument in AutoToggle . - Replaced get_video_device_paths with get_video_devices . - Enhanced error handling in handle_autotoggle_command and added NoVideoDevicesMonitored to CliError . |
auto-toggle
command, which is relevant as it modifies the handle_autotoggle_command
function and the CliError
enum, similar to the changes made in the main PR regarding the AutoToggle
command.tokio
as an optional dependency in Cargo.toml
, which is related since the main PR also involves modifications to Cargo.toml
, specifically adding a new optional dependency v4l
.π In the land of code where bunnies play,
New features hop in, brightening the day.
Withv4l
now added, andclap
in full bloom,
Our commands dance freely, dispelling the gloom.
So letβs toggle and brighten, let devices unite,
In the world of Litra, everything feels right! π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Closing this as I've moved auto-toggling to a separate project, https://github.com/timrogers/litra-autotoggle
Adds a way a select a single video device to monitor for the
auto-toggle
command.Also, both the Litra serial number and the video device path can be configured using environment variables instead of passing it as command line argument. The following environment variables are available:
LITRA_SERIAL_NUMBER
LITRA_VIDEO_DEVICE_PATH
For video device selection, a serial number would be preferable, because that would theoretically work on other OSes and make it possible to add support for Windows and macOS later on. However, I'm not aware of a straightforward way to do that. Both
v4l
andnoktha
crates do not seem to expose such information.Summary by CodeRabbit
New Features
serial_number
andvideo_device_bus
.AutoToggle
command for specifying the video device path.Bug Fixes
AutoToggle
command to check for available video devices.Chores