Kindle: toggle cover events

Allow disabling the hall efect sensor via the sysfs knob, so the kindle system wont sleep & wake the device

for those of use that stay in koreader, are caseless and have get spurious wakeups
This commit is contained in:
yparitcher
2023-05-03 10:26:35 -04:00
committed by GitHub
parent 4f23a6fafa
commit 1102c030fa
9 changed files with 81 additions and 63 deletions

View File

@@ -40,7 +40,6 @@ describe("device module", function()
after_each(function()
mock_input.open:revert()
os.getenv:revert()
os.execute:revert()
os.getenv = osgetenv
io.open = iopen
@@ -278,8 +277,6 @@ describe("device module", function()
assert.is.same(kindle_dev.powerd.fl_intensity, 5)
kindle_dev.powerd:toggleFrontlight()
assert.stub(os.execute).was_called_with(
"printf '%s' 0 > /sys/class/backlight/max77696-bl/brightness")
-- Here be shenanigans: we don't override powerd's fl_intensity when we turn the light off,
-- so that we can properly turn it back on at the previous intensity ;)
assert.is.same(kindle_dev.powerd.fl_intensity, 5)