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
Automatic turn-on/turn off does not work #34
Comments
Hey, thanks for the feedback!
That is weird, sorry for the inconvenience. Was the filter still running or only the notification? Could your phone have been turned off at 06:00?
The "Keep running after reboot" determines if the state of the filter is restored after reboot and if the "Always open on startup" preference is checked the filter will always open when the device is booted, even if it wasn't open when the device was turned off. However both these settings will be removed in the next version, because they are quite ambiguous and confusing as pointed out in #29. |
Wow, I did not expect such a fast answer ! :D I did some more tests inbetween : turning ON works fine, but turning OFF does not. Thanks for the info regarding the startup options. Also, the toggle at the top of the UX is a bit misleading : I first thought it toggles the automatic start on/off, while it actually simply turns the FILTER on/off. |
Er… that's wierd : I tried again and it turned off, although not precisely at 10:39'00", but more like 10:39'30" |
Ah okay, thanks for testing! When you select a minute and an hour, it actually schedules the alarm for hour:minute:current seconds, where current seconds is the seconds of the time when you schedule it. Red Moon does this to ensure that it doesn't miss an alarm, however I will be looking into other solutions in the future. With that said, it is still very peculiar that the filter didn't turn off at 06:00. I've looked into the code and it seems that if the device is turned off when the filter should be turned off, the filter can keep running. Could this also be the reason the filter didn't turn off for you? |
Okay, that explains the seconds thing. Sorry for not replying earlier : no, my phone was not off. I usually turn it to airplane mode during the night, though I did not do it last night. But come to think of it : my phone sometimes experiences random (soft) reboot, so it might have rebooted during the night without me noticing. I guess you can close that issue : I'll keep an eye out for any strange behaviour and comment back if something is wrong. |
Great, I will look into making sure that the filter is turned off/on if the device is off when the turn off/on signal is given. Thanks for the quick replies and please let me know if you encounter any more problems! |
@breversa the top-level switch is confusing right now. It toggles the Red Moon service on and off. If you turn it off, Red Moon should be completely disabled, as if it were uninstalled. It will never display the filter and never automatically turn on. The confusing part is: When you pause the filter, the top-level switch shows itself as off when the setting it controls is actually on. There's an item in #29 to address this. |
Okay, I'm now officially lost ! :D Just how do you turn on the service without turning on the filter ? Here's what I did :
|
@raatmarien Haha, this is why we should remove all references to "the service". @breversa In the next version of Red Moon you will not need to know the answer to this question to use the app :). The service is the process that runs in the background when Red Moon is enabled. I'm just going to call it the process from now on because that's clearer. When you pause the filter, the background process is still running -- that's what keeps the notification alive so you can resume again. It's also how the filter can automatically start at a certain time (the process is running always, doing mostly nothing except watching the time). When you stop the filter, the process is killed, which is why the notification stops showing. For now, I think the easiest way to think about it is "service = notification." The top-level switch should turn the notification (and all the features that go along with it) on and off. |
@smichel17 : |
What edge case does this solve?
This hits the nail on the head. @raatmarien I think these are the to-do's that come out of this ticket. First:
Second, what is that logic? I'd like to see the 'Complex' logic, which is why I did not include this in #29.
The best way to clarify what I mean in the complex version is to write out all the edge cases. If you replace "powering off/on" with "enabling/disabling Red Moon", the filter state should respond the same way. I enable Red Moon and set the filter to 'sun'. It is currently night and the filter is on. If I...
I enable Red Moon and set the filter to 'sun'. It is currently day and the filter is paused. If I...
|
What are the use cases that the complex logic would address ? I for one would be perfectly happy with the simple logic, as the only time I'd need to pause the filter (if on, of course) is to install APKs (I solely use Red Moon to filter out the blue light, not to dim the screen). The complex logic would actually bother me more if I rebooted straight after an install (hence still in pause), since I'd have to de-pause after reboot, while I'd expect a simple logic behaviour : device boots, Red Moon starts (and applies the filter according to the settings). What's more, I don't readily understand why the behaviour should change between reboot and power off/on… and I'm pretty sure other users wouldn't either. And what about the difference between standard reboot and soft boot that some ROMs (like CyanogenMod) offer ? |
Hi all! |
@breversa In reverse order...
The important variable is not reboot vs boot, it is the amount of time that passes. So a soft reboot acts just like a normal reboot, which acts just like powering off and then powering immediately on. I have updated the post above so that I never use the word "reboot", to clarify this.
Replace "power off" and "power on" with "my phone dies" and "I charge the phone" in any of the edge cases, and you have your use cases. But -- I think the real question here is why would you expect that behavior? I tried to communicate that in the original comment but was tired and not very ariculate 😴
Let me try to clarify: The premise is "If I leave my phone on and service enabled all the time, Red Moon will have a certain behavior. This is the desired behavior: If I turn my phone off or disable the service, when I power on or enable the service, the state should be the same as if I had left my phone on & service enabled the entire time." The current behavior does very poorly at following this premise. The simple behavior fixes the most egregious departures from this premise but regresses in some edge cases. The complex behavior fixes the edge cases. If you agree with this premise, I can pick a few specific scenarios and explain why they are good or bad. |
#36 affects this issue, making it much clearer. It adds a 'stop' state. I have an analogy! A helpful way to think of the settings is like one of those white noise makers that people use when they sleep. Plugging it into the wall is like enabling the top switch. Start/stop is like hitting the power button to turn it on and off. This particular model makes noise whenever it is turned on, unless you pause it. You can also schedule times for it to automatically turn on and off (but of course those won't do anything if you unplug it).
Note: the above two rules summarize ALL of the "complex logic." It's just shorter because I don't need to write out "paused and notification off" etc. |
Thanks @smichel17! This explanation is amazing, but nigth ligth for kids is
what got my mind.
Perhaps the basic native persistence of android could do the trick, but Im
too novice to known if it ensures writeout on kill or reboot.
|
I've implemented the simple logic for now. Although I do see the merits of the complex system, it would be quite a bit of work to implement for a few edge cases. I may however implement the complex logic when I have the time (or someone else can if they want 😄). |
@raatmarien Yeah, definitely not worth trying to implement the complex logic, at least until #36 is implemented, since that will make the complex logic much simpler (though figuring out the hours passed is still a bit of a pain. You'd have to track time of power off or something). |
@smichel17 : |
Hi there !
I happily discovered Red Moon as an alternative to Twilight on F-Droid.
However, automatic turn-on/turn at custom times does not seem to work : I set it to run between 20:00 and 06:00, but it did not stop at 06:00.
Also, I'm not quite sure what the two startup options do ("Keep running after reboot" and "Alway open on startup") : do they mean that Red Moon doesn't normally start at boot to monitor automatic turn on/off times, and that reboot behaves differently than normal boot ?
The text was updated successfully, but these errors were encountered: