Skip to content

Commit

Permalink
fix: return correct brightness value for Litra Beam and Litra Beam LX…
Browse files Browse the repository at this point in the history
… devices

Litra Beam and Litra Beam LX devices can currently return an
incorrect brightness value when brightness is set above Litra
Glow's 250 Lm maximum brightness.

Fixes #36.
  • Loading branch information
timrogers committed Mar 14, 2024
1 parent 9337671 commit 0bd7fc0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ impl DeviceHandle {
let mut response_buffer = [0x00; 20];
let response = self.hid_device.read(&mut response_buffer[..])?;

Ok(response_buffer[..response][5].into())
Ok(u16::from(response_buffer[..response][4]) * 256
+ u16::from(response_buffer[..response][5]))
}

/// Sets the device's brightness in Lumen.
Expand Down

0 comments on commit 0bd7fc0

Please sign in to comment.