Skip to content

Profiles: auto-exec time interval#13399

Merged
hius07 merged 2 commits into
koreader:masterfrom
hius07:profiles-auto-exec-time
Mar 13, 2025
Merged

Profiles: auto-exec time interval#13399
hius07 merged 2 commits into
koreader:masterfrom
hius07:profiles-auto-exec-time

Conversation

@hius07

@hius07 hius07 commented Mar 11, 2025

Copy link
Copy Markdown
Member

To turn the light on in the night only:

1


This change is Reviewable

@hius07 hius07 added the Plugin label Mar 11, 2025
@ghost

ghost commented Mar 11, 2025

Copy link
Copy Markdown

Have not looked into your code yet, but maybe you want to add a sunrise and sunset time too ;)

(If that is the case, I could add some callbacks to the autowarmth plugin to get the dates directly.)

@hius07

hius07 commented Mar 11, 2025

Copy link
Copy Markdown
Member Author

Thanks, I look sometimes at your plugin when developing date-time features.
Let's wait for some feedback to understand use cases of profiles auto-execution.

@hius07 hius07 merged commit 5e6a361 into koreader:master Mar 13, 2025
@hius07 hius07 deleted the profiles-auto-exec-time branch March 13, 2025 06:15
@hius07 hius07 added this to the 2025.02 milestone Mar 13, 2025
@mergen3107

Copy link
Copy Markdown
Contributor

Sorry, didn't have time yet to test this. Will do soon

@mergen3107

mergen3107 commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

@hius07
When I first selected start date and used arrows (and long taps to jump from 53 min to 00 min) and then hit Save, it applied the time I set (20:00) to both start and end. I then set end to a different value, and it worked OK.

Update: after both start and end are set, none of them are overridden by further changes.

@mergen3107

mergen3107 commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

It didn't work for me in my use case:
Auto exec doesn't fire up at all - if I have a gesture to unlock. Top menu - Gear - Screen - Sleep screen - Wallpaper - Postpone screen update after wake-up - Until 'exit sleep screen' gesture

Otherwise, with no screen unlock gesture, it works great!
I need to select by time inverval + other trigger (I tried wake up) as triggers to make it work.

Tested various time intervals - the all work.

@hius07 Do you think the above issue can be fixed?

@hius07

hius07 commented Mar 14, 2025

Copy link
Copy Markdown
Member Author

Auto exec doesn't fire up at all - if I have a gesture to unlock. Top menu - Gear - Screen - Sleep screen - Wallpaper - Postpone screen update after wake-up - Until 'exit sleep screen' gesture

Otherwise, with no screen unlock gesture, it works great!

Can you test with replaced koreader/frontend/dispatcher.lua
dispatcher.lua.txt

Also asking @NiLuJe and @yparitcher:
do you see negative side effects of changing UIManager:sendEvent to UIManager:broadcastEvent in

function Dispatcher:execute(settings, exec_props)

@NiLuJe

NiLuJe commented Mar 14, 2025

Copy link
Copy Markdown
Member

Which ones?

@hius07

hius07 commented Mar 14, 2025

Copy link
Copy Markdown
Member Author

Any :)

@mergen3107

mergen3107 commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

Can you test with replaced koreader/frontend/dispatcher.lua

Thanks, @hius07 ! That did it, it works now.
The profile I set up (set frontlight and warmth to specific values) kicks in almost immediately after waking up to unlock screen.

Other dispatcher events, like Quick Menu profiles, didn't break

@mergen3107

Copy link
Copy Markdown
Contributor

@hius07
Any more testing I can help with?
Would like to add this change to dispatcher?

@hius07

hius07 commented Mar 17, 2025

Copy link
Copy Markdown
Member Author

I'm not sure yet, need to read more about events.

@hius07

hius07 commented Mar 18, 2025

Copy link
Copy Markdown
Member Author

Please restore original dispatcher.lua and use the new trigger from #13430.

@Frenzie

Frenzie commented Mar 18, 2025

Copy link
Copy Markdown
Member

Please restore original dispatcher.lua and use the new trigger from #13430.

I think you probably meant to post that somewhere else?

@hius07

hius07 commented Mar 18, 2025

Copy link
Copy Markdown
Member Author

It's for @mergen3107

@offset-torque

Copy link
Copy Markdown

Some questions for the user guide:

  1. What are some useful examples for this trigger?
  2. Does it fire once between the interval? Or used as an "AND" condition when combined with another trigger?
  3. Why the example is "turning on light"? We have an extensively configurable auto night mode. Why would a user want to use this instead?

@hius07

hius07 commented Nov 18, 2025

Copy link
Copy Markdown
Member Author

It's a filter applicable to any trigger.

@offset-torque

Copy link
Copy Markdown

So this is not a trigger but a limiter for the profiles?
If yes, I suggest renaming the menu item to emphasize its nature because it sounds like a trigger now.

Something like:

  • Limit profile execution interval >
  • Execute this profile only between >

These sound more like a restriction (negative action) instead of a trigger (positive action) so less chance to mix up with triggers.

@hius07

hius07 commented Nov 18, 2025

Copy link
Copy Markdown
Member Author

Does it look like a trigger? Triggers start with "on".

1

@Frenzie

Frenzie commented Nov 18, 2025

Copy link
Copy Markdown
Member

You could consider"only within" instead of "execute within"?

@offset-torque

Copy link
Copy Markdown

You could consider"only within" instead of "execute within"?

+1

Does it look like a trigger? Triggers start with "on".

  • I noticed that, but then I thought "this sentence can't start with on gramatically" so it still can be a trigger despite the difference.
  • Then I noticed the separator line, thought that it might not be a trigger due to separation
  • But then I noticed the second separator line between triggers, so first separator lost it separator-ness between general profile settings and triggers.

So in addition to Frenzie's suggested correction, I also suggest removing the second separator so the first line divides profile settings/triggers properly.

0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants