Commit Graph

31 Commits

Author SHA1 Message Date
Cameron Fleming 8071f81310 fix: wakeDisplay() doesn't need to stop the tickers
The tickers only need to be reset, if they're disabled, they won't have
been started.
2025-01-28 22:00:23 +00:00
Cameron Fleming 9896eba02a fix(display): Don't attempt to start the tickers if the display is disabled
If max_brightness is zero, then there's no point in trying to dim it (or
turn it off...)
2025-01-28 21:49:26 +00:00
Cameron Fleming f5035f28c9 chore: fix some start-up timing issues 2025-01-28 20:45:55 +00:00
Cameron Fleming 6445628114 fix(display): move backlightTicker setup into screen setup goroutine
Signed-off-by: Cameron Fleming <cameron@nevexo.space>
2025-01-28 12:59:50 +00:00
Cameron Fleming a05df7a16b chore: update variable names
As part of @joshuasing's review on #17, updated variables & constants to
match the Go best practices.

Signed-off-by: Cameron Fleming <cameron@nevexo.space>
2025-01-28 09:10:27 +00:00
Cameron Fleming a6eab94e0d feat(ui): implement display backlight control 2025-01-27 20:56:52 +00:00
Cameron Fleming 309d30d3c3 feat(rpc): implement display backlight control methods 2025-01-27 20:56:52 +00:00
Cameron Fleming cabe5b07ab feat(display.go): stop tickers when auto-dim/auto-off is disabled 2025-01-27 20:51:12 +00:00
Cameron Fleming 7d1777985f feat(display.go): move tickers into their own method
This allows them to only be started if necessary. If the user has chosen
to keep the display on and not-dimmed all the time, the tickers can't
start as their tick value must be a positive integer.
2025-01-27 20:51:12 +00:00
Cameron Fleming e9f140c735 feat(display.go): wakeDisplay() force
Adds the force boolean to wakedisplay() which allows skipping the
backlightState == 0 check, this means you can force a ticker reset, even
if the display is currently in the "full bright" state
2025-01-27 20:51:12 +00:00
Cameron Fleming 34e42fd37c chore: update config
Changed Dim & Off values to seconds instead of milliseconds, there's no
need for it to be that precise.
2025-01-27 20:51:12 +00:00
Cameron Fleming 79bac39b6b feat(display.go): use tickers to countdown to dim/off
As suggested by tutman in https://github.com/jetkvm/kvm/pull/17, use
tickers set to the duration of dim/off to avoid a loop running every
second. The tickers are reset to the dim/off times whenever
wakeDisplay() is called.
2025-01-20 19:52:53 +00:00
Cameron Fleming daaddefe51 fix: set default value for display
Set the DisplayMaxBrightness to the default brightness used
out-of-the-box by JetKVM. Also sets the dim/timeout to 2 minutes and 30
mintes respectively.
2025-01-20 18:38:01 +00:00
Cameron Fleming e9b539053b fix: newline on set brightness log
Noticed by @eric
https://github.com/jetkvm/kvm/pull/17#discussion_r1903338705
2025-01-05 21:13:09 +00:00
Cameron Fleming 1fe71da77d chore: various comment & string updates 2025-01-05 02:24:53 +00:00
Cameron Fleming 7e7310b176 fix: wakeDisplay() on start to fix warm start issue
If the application had turned off the display before exiting, it
wouldn't be brought on when the application restarted without a device
reboot.
2025-01-04 22:27:10 +00:00
Cameron Fleming d6e4df2109 fix: re-use buffer between reads 2025-01-04 22:26:39 +00:00
Cameron Fleming 74cdeca230 feat(display): wake on touch 2025-01-04 22:22:50 +00:00
Cameron Fleming a267bb3a1d fix: only attempt to wake the display if it's off 2025-01-04 22:22:43 +00:00
Cameron Fleming db4c0c7136 chore: use constant for backlight control file 2025-01-04 22:22:43 +00:00
Cameron Fleming f4d88c7162 WIP: feat(settings): add Max backlight setting 2025-01-03 22:15:15 +00:00
Cameron Fleming bec1443fe6 feat(rpc): add methods to get and set BacklightSettings 2025-01-03 22:07:21 +00:00
Cameron Fleming cd7258efd0 feat(display): add automatic dimming & switch off to display
WIP, dims the display to 50% of the BacklightMaxBrightness after
BacklightDimAfterMS expires. Turns the display off after
BacklightOffAfterMS
2025-01-03 22:07:05 +00:00
Cameron Fleming 4fd8b1e6ff feat(config): add backlight control settings 2025-01-03 22:05:46 +00:00
Cameron Fleming 3271a1796b feat(display.go): impl setDisplayBrightness()
Implements setDisplayBrightness(brightness int) which allows setting the
backlight brightness on JetKVM's hardware.

Needs to be implemented into the RPC, config and frontend.
2025-01-03 11:42:21 +00:00
Cameron Fleming 8ffe66a1bc
chore: use github.com/coder/websocket instead of nhooyr.io/websocket (#14)
nhooyr.io/websocket has been deprecated and is now maintained by Coder,
https://github.com/coder/websocket.

Also bumps to 1.8.12 which is compatible.
2025-01-02 23:51:29 +01:00
Adam Shiervani e445039cb8
Don't allow empty tokens (#13) 2025-01-02 21:44:26 +01:00
Nilesh Savani ca815c06f1
Update index.html - fixed fonts url (#4) 2025-01-02 21:44:09 +01:00
Brandon Tuttle ed93400758
Add devcontainer support (#8) 2025-01-02 20:00:44 +01:00
Ben Kochie 6e2177e427
Fix: Update react-icons package (#5)
Bump the react-icons NPM package to solve missing `LuEllipsisVertical`
icon.

Signed-off-by: SuperQ <superq@gmail.com>
2024-12-31 14:23:23 +01:00
Adam Shiervani 20780b65db Release 202412292127 2024-12-29 21:27:42 +01:00