Falcosc / locus-addon-tasker

Locus Maps API useable as Tasker Plugin
GNU General Public License v3.0
9 stars 2 forks source link

is_track_rec_recording #3

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hello,

in tasker locus plugin I am using feature is_track_rec_recording. I'm setting some global variable to 1 when track recording is "true" and execute some other tasks based on it, live beacon tracking and some other stuff. Problem is when in locus i start recording nothing happens until i minimise the locus and put it back to focus. Only then all my stuff executes. Also, when i press stop, i need to minimise and bring app back to focus for my stuff to continue. Can you please check this?

Thanks in advance,

Igor.

Falcosc commented 5 years ago

How do you pull the is_track_rec_recording value?

There is no auto update implemented. The plugin does only request data from locus when you request it.

Things like "do something when locus does start recording" do not work without making a task which does execute check state every 10s

Have a look at example Center Map to GPS on move https://github.com/Falcosc/locus-addon-tasker/wiki/Examples#center-map-to-gps-on-move

this does update data every 5s, which result into an event response delay from 1ms to 4999ms You need to copy this example and put your is_track_rec_recording handling into this loop (set global var inside loop may do not work because tasker set var change event doesn't work for me, but this is maybe a tasker bug because the is var changed event should work if you set the variable inside an task loop)

But please before you go on you should setup and test the example "Center Map to GPS on move" without modifications. If this example does work on your device your tasker setup is correct and you can go on and change it from check speed to check is recording. There are many things that can go wrong with tasker.

If the example does work and you don't know how to change it to request the recording state, you can ask me again. Have fun :)

Falcosc commented 5 years ago

And if you ask why I did not implement an auto update, Locus API does not push the data, you need to request each state in a loop. I don't want to implement such a loop into the plugin because for most people this would be a waste of battery. But you can do it with Tasker as I did with example Center Map to GPS on move

ghost commented 5 years ago

Thanks for the explanation, i get it now, i was thinking data gets pushed, i will try to implement check in a loop.

Falcosc commented 5 years ago

There is a hidden feature in locus. An outdated push API. In expert settings you can enable "update container" it's a data push from locus. But this thing is outdated, not supported by me and hidden in locus map settings for one reason: wasted execution time.

This old feature did calculate, transform and push all available field every second to android as a large intend which is also expensive to parse because you need to read all the fields to extract your single boolean there.