henrichg / PhoneProfilesPlus

Profile manager for Android - event triggered
Apache License 2.0
389 stars 32 forks source link

[Feature request] Manual Event sensor #86

Open balporig opened 2 years ago

balporig commented 2 years ago

A sensor that can be triggered by clicking on a widget or shortcut

henrichg commented 2 years ago

PPP has 3 widgets: "icon", "one row", "list" (for Samsung devices also edge panel) . In "list" (edge panel) is possible to activate profile. In "icon" and "one row" click opens Activator/Editor (by configuration).

In "list" is possible to configure it without header (click to header opens Editor). "List" can be of type list (as in Editor, each profile id displayed by oicon, name, preference indicators) or grid (icon and name). Edge panel only grid.

Also shortcut is implemnted. Shortcut to profile.

This is not as you want? You means widget with list of events? Why is this needed?

balporig commented 2 years ago

Sensors are something that monitor change in state. The only way to trigger an event is for one of the sensors to detect a change in state. Events do enable/disable profiles, but fundamentally they expect a change in state not provided by the user and cannot be triggered in such manner. There is only a shortcut to restart all events but not trigger an event just as you can do with profiles. Imagine you scan an NFC tag by mistake and to prevent that it requires also manual confirmation by also either confirming a dialog or manual trigger by a shortcut/widget. Or you can have some very elaborate set of events that will start watching for changes by first being initiated manually by shortcut as they do not having a regular repeating pattern depending on time/date. One of the new features in version 6 will be to have a sensor to check what profile you're currently in/changed to which will enable chaining (from chain not change) event in a more complex ways.

My proposal is to have a shortcut for each event which will act like a button. If pressed will be registered as trigger. There will be a corresponding manual sensor for each event, which if enabled will accept the trigger coming only from the shortcut for that event.

henrichg commented 2 years ago

OK, then must be new sensor which wlill check for click to event in widget (must be added new widget, shortcut for events, not profiles).

But this click is one state. It does not has end. Examples are: "Device boot sensor", "Alarm clock sensor", "NFC sensor". In this new "Click sensor" must be parameters: "Permanent run", "Duration".

Is this sensor needed? By me not. Maybe problem is flag "manual activation", but is also possible to configure in event "Ignore manual activation". If is enabled, event will be started even when any profile is activated manually (by user).

balporig commented 2 years ago

It does have its use cases. Ignore manual activation is a condition, not a trigger, so even if enabled will not run the event without the trigger.

henrichg commented 2 years ago

Role of event (and its sensors) is not to start it by user (as profile activation), but start it by changes in system. Again, starting event by user requires parameter "Duration" in this sensor.

Why you need it? For testing of event configuration by user?

balporig commented 2 years ago

Role of event (and its sensors) is not to start it by user (as profile activation), but start it by changes in system.

Get that, but for example NFC is still manual trigger as the user needs to scan the tag, of course it is detected by the system but is user initiated. If you switch the NFC sensor with other form of manual activation, you get the same result.

Again, starting event by user requires parameter "Duration" in this sensor.

It can be provided, the same as NFC as it is a manual action anyway.

Why you need it? For testing of event configuration by user?

If NFC is not available, there is no other manual way to trigger an event. Useful for phones without NFC hardware sensor.