Coder Social home page Coder Social logo

Events with periodisity about easer HOT 7 CLOSED

renyuneyun avatar renyuneyun commented on August 23, 2024
Events with periodisity

from easer.

Comments (7)

ildar avatar ildar commented on August 23, 2024

from easer.

yamatt avatar yamatt commented on August 23, 2024

@ildar hi. Thanks for that. I'll look in to it, but the WiFi was an example, so it's probably a bit too specific for my needs.

from easer.

renyuneyun avatar renyuneyun commented on August 23, 2024

Yup, I like this idea :)

Actually I've thought about it once, but can't decide the proper semantics for this kind of events. Suggestions wanted:

Currently events are tree-structured. A child event will be checked only after all its parents (parent, grandparent, ...) are satisfied. Each event (together with its type) has a mark to control whether its child events should be sticky / put into top level (e.g. exactly at a time will have a different mark than after a time).
Are there any ways to keep the current semantics and add the ability to control something (and reverse it) after some time? I can think of the situation that we may want to open wifi every 10 minutes to sync data and then (maybe 5 minutes later) close it to save battery.
If the old semantics can't satisfy the new need, how should the new semantics be designed?

from easer.

yamatt avatar yamatt commented on August 23, 2024

@renyuneyun I would think it would just be a new event type like "TIme" and "Date", and the "repeating" event would simply be an integer that runs on an integer, every x minutes or x hours.

from easer.

renyuneyun avatar renyuneyun commented on August 23, 2024

@yamatt Then what about reversing / reverting or pairing that operation?

I mean, for example, turn on WiFi every 10 minutes, and then turn it off 2 minutes later.

I'm still not sure about what the semantics should be...

from easer.

ksamak avatar ksamak commented on August 23, 2024

Hi, just bumping log to get the follow up in the thread.

from easer.

renyuneyun avatar renyuneyun commented on August 23, 2024

Finally, that is implemented :)>
They are added in v0.5. (Thought due to a strange f-droid bug, the date when v0.5 enter the repo is unpredictable... Maybe a few days later, maybe weeks...)

The implementation is in the form of a "timer" which simply delays the detection and execution of its successors.

Therefore, if we want to connect to cellular network for 1 minute and then sleep for 10 minutes, the senario will be:
0. Add an event (A) checking that we have left home

  1. Add an event checking the network type is cellular, and set the parent to A
    1.5. Add an event using timer of 1 minute, and active a profile which turns cellular data off
  2. Add an event checking the network type is not cellular (or "none" or everything else if you like), and set the parent to A
    2.5. Add an event using timer of 10 minute, and active a profile which turns cellular data on

They will work as intended in principle :)

I'm closing this issue. Feel free to open new issues if that doesn't work well.

from easer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.