-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add support for setting Warmth for Tolino with ntx_io
#382
Conversation
app/src/main/java/org/koreader/launcher/device/lights/TolinoWarmthController.kt
Outdated
Show resolved
Hide resolved
Please test your code before opening a PR ;) Also, even if this worked without root it must go on a different driver and leave this one as is. But it won't work without root. And if you have root there're better ways of doing the same. |
i dont know what you mean, i did test it
why? from what i can tell, this is a controller for Tolino devies, and i set it up for a tolino device, with fallback to the old way
like i already said in koreader/koreader#9511 (comment), it works without root |
Sorry about that. My fault. I was biased based on previous experiences (not with you).
because we don't have all past tolino devices to test this new way of doing stuff, which is fragile. And we have past experiences with changes in drivers that work on newer ones but borked legacy devices. Just create a new driver, let people test your driver and report if it also work. We can do a device migration from one to another without nuking the old one.
That's fantastic. You can code it like a simple c function and call it from your driver. Like we're already doing in https://github.com/koreader/android-luajit-launcher/blob/master/jni/lzma/un7z.cpp#L9, |
good to hear that it is possible this way, but i dont trust my self with c |
also i forgot to note in the opening description of this PR: getting the warmth value does not work and defaults to MAX, if it is possible to read from ntx_io then i have not found that way yet (and |
That also sounds like a familiar NTX quirk, so I doubt there's a sane solution ;). |
That's a drag but I think it won't be too bad. After all it will affect just the first read. After that you can keep current level into a var and update it each time the ioctl call doesn't fail. Ofc it would be great to retrieve current warmth level from system somehow.
No problem with that. I can help. Could you please rework this PR as a different driver? I can submit a PR against your branch so you can test it. |
updated 8995d0d to have a new controller named for now i have named all new things (controller and enum value in i have also tested the change and it works great (after keeping the state) without root, but it still requires koreader/koreader#9511
if you can / want to do it, thanks, but i will probably replay later because i need to stop for today |
@hasezoey: done in https://github.com/hasezoey/android-luajit-launcher/pull/1 Please test when you have a moment. I'm also interested in @NiLuJe review. I've tried to be very verbose about errors, mostly to be useful in the test activity. If some other device uses |
re https://github.com/hasezoey/android-luajit-launcher/pull/1#issuecomment-1246741868
it seems like i dont need to merge master, because it is still up-to-date |
The C bits look sound ;). |
Yup, I can't fully judge it but it doesn't smell. ;-) |
app/src/main/java/org/koreader/launcher/device/lights/TolinoVision5WarmthController.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/koreader/launcher/device/lights/TolinoVision5WarmthController.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/koreader/launcher/device/lights/TolinoVision5WarmthController.kt
Outdated
Show resolved
Hide resolved
Updated to resolve some review questions, among other things:
|
As you can see in other driver's name I'm not very good naming stuff :p. So feel free to suggest alternatives. My recommendation is: rename the old TolinoWarmth to TolinoRoot and the new one to TolinoNtx. IMHO the |
Updated to rename the controllers |
app/src/main/java/org/koreader/launcher/device/lights/TolinoNtxController.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/koreader/launcher/device/lights/TolinoRootController.kt
Outdated
Show resolved
Hide resolved
great, almost ready to go! to-do: handle the new driver in LightsFactory. I still need to figure a proper way to do that. could you rebase on top of master to see an updated codacy analysis? |
merged latest master |
hey, just force pushed. When I requested a rebase I meant:
I'm fairly sure that git being git there're a million ways of doing the same |
Yes, your force push broke things. It was ok when I force pushed. |
broke what? from what i can tell, it builds just fine and after the install it also works just fine (in the compat report) |
your last commit was left in the void. Could you please fix that? Thanks |
what last commit? like i said, i dropped the commits that renamed the Edit: see 908d6a7, that was the last commit (that you had pushed after your rebase), where the parent is 2039ce1, which is still included |
Yup, I'm at work and understood your comment #382 (comment) wrong. All good as is. |
And a final question because I got it wrong in the first place: with this PR in both the TestActivity's and KOReader's lightdialog work as expected? |
app/src/main/java/org/koreader/launcher/device/LightsFactory.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/koreader/launcher/device/LightsFactory.kt
Outdated
Show resolved
Hide resolved
no, with this PR the new driver works as expected, and is correctly set in the TestActivity, but not "globally", i (locally) added a fix in a local branch, but i will wait for the official solution you mentioned in #382 (comment) my local solution currently for that is: |
…h controller is used
Hmm. My solution isn't required. I got it wrong. There're no TOLINO on the Lights iterator, just TOLINO_EPOS and TOLINO_VISION, so the only way the factory is assigning you a bad driver is because your device is flagged as an EPOS before it is flagged as a VISION. You can test that by removing TOLINO_EPOS from the lightsMap. If that is the case then we need to fine tweak the TOLINO_EPOS condition. I think it got reported somewhere, let me check. |
i think i wrote about this before, but i cannot find it anymore, so i will write it here again: |
aaaahhh, now all makes sense. I would rather prefeer to tweak Tolino epos to be true with current condition if not HARDWARE.contentEquals("e70k00"). Apologies for the missunderstanding, I'm doing all this in coffee breaks and have little time to get things right ;) |
if the tolino software download site is anything to go by, then:
*1: but as can be seen in #351 (comment), the Shine3 is listed as |
Thanks for the info. I'm afraid we can't figure out how things are without temporarily breaking (or not?) the lights controller on the EPOS/EPOS2. Even if we break them it is not that traumatic. On a couple of months somebody will report the regression paired with test results and we will be in a better position to judge :) |
if you really dont wanna break it, then i guess the following options would be possible:
|
I stated that I wouldn't mind to break it. And prefeer to break it better than refactoring for a worse implementation or custom workarounds. |
to me it sounded more like you are considering to break it, so i just wrote some "options" i could think of when do you wanna do this change, in this PR or separately? |
In this PR is fine. It should be a matter of doing something like diff --git a/app/src/main/java/org/koreader/launcher/device/DeviceInfo.kt b/app/src/main/java/org/koreader/launcher/device/DeviceInfo.kt
index 8b8b9d2..ec54674 100644
--- a/app/src/main/java/org/koreader/launcher/device/DeviceInfo.kt
+++ b/app/src/main/java/org/koreader/launcher/device/DeviceInfo.kt
@@ -386,6 +386,7 @@ object DeviceInfo {
TOLINO_EPOS = BRAND.contentEquals("rakutenkobo")
&& MODEL.contentEquals("tolino")
&& DEVICE.contentEquals("ntx_6sl")
+ && !HARDWARE.contentEquals("e70k00") Please check it works fine that way. The rest of the PR is ready to go. |
added with 2ea428e and also tested to work in non-TestActivity personally, i also think this will not affect EPOS1 or EPOS2, because if the hardware numbering is anything to go by, it should be older though i dont know about EPOS3, but i think it is at least |
Nope, those are NTX board ids ;). e for EPD, 80 for 8.0", and the rest probably has some deeper meaning, too ;). |
i guess makes sense, i didnt think it had much meaning but more like PCB version / hardware revision number (which probably would increase with generation) |
Hi, |
This PR adds support in
TolinoWarmthController.kt
to use/dev/ntx_io
to set the Warmthfixes #351
requires koreader/koreader#9511This change is