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

refactor sysfs_light #4283

Merged
merged 1 commit into from Oct 27, 2018

Conversation

Projects
None yet
2 participants
@pazos
Contributor

pazos commented Oct 22, 2018

syfs_light was written originally for Kobo Aura One but works fine on other devices w/ natural light (like other new kobos and Bq cervantes 4).

Some devices don't have a green led and /dev/null is used as the sysfs_path, causing log errors trying to write to /dev/null/bl_power and the like.

This PR moves sysfs_light outside kobo realm (because I'm going to use in cervantes) and removes the Kobo Aura One values hardcoded in the file. It doesn't try to write to nil dirs, so errors in log are also removed.

@Frenzie

syfs_light was written originally for Kobo Aura One but works fine on other devices w/ natural light (like other new kobos and Bq cervantes 4).

Also see #3709 ;-)

self:_write_value(sysfs_directory .. "/bl_power", 31)
else
self:_write_value(sysfs_directory .. "/bl_power", 0)
if sysfs_directory ~= nil then

This comment has been minimized.

@Frenzie

Frenzie Oct 22, 2018

Member
Suggested change Beta
if sysfs_directory ~= nil then
if not sysfs_directory then return end
@@ -1,14 +1,14 @@
-- Interface to the SysFS interface of the Kobo Aura One Frontlight.
-- Generic SysFS interface which happens to work on modern Kobo/BQ devices.

This comment has been minimized.

@Frenzie

Frenzie Oct 22, 2018

Member
Suggested change Beta
-- Generic SysFS interface which happens to work on modern Kobo/BQ devices.
-- Generic SysFS interface

@Frenzie Frenzie added the enhancement label Oct 22, 2018

@pazos pazos force-pushed the pazos:sysfs_light branch from 6a3f968 to 9a28bbd Oct 22, 2018

@Frenzie

lgtm, please ping if I forgot to merge it in a couple of days

(I prefer to wait a little longer to merge to be sure these GH technical issues are truly over.)

@Frenzie Frenzie merged commit 29835b3 into koreader:master Oct 27, 2018

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@pazos pazos deleted the pazos:sysfs_light branch Nov 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment