mathisdt / trackworktime

Android app to track your work time via WiFi or location and categorize each recorded intervall by a predefined client/task and a free text.

Home Page:https://zephyrsoft.org/trackworktime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature request] Broadcast intents for ClockIn/ClockOut.

zelch opened this issue · comments

It would be extremely handy for other automation if it was possible to setup Tasker triggers on ClockIn / ClockOut events, so I could do stuff like change my slack status when clocked in vs out, or something similar.

However as far as I can tell, trackworktime only accepts ClockIn/ClockOut intents, as well as status requests, but doesn't emit anything when you clock in or out.

Could it be coincidence? Two hours before this issue was created, I commented over at #216 that creating (broadcast) intents would make sense for their use case... 😄

Broadcast intents will be in release 1.1.18.

available intent actions (depending on what has happened):

  • org.zephyrsoft.trackworktime.event.Created
  • org.zephyrsoft.trackworktime.event.Updated
  • org.zephyrsoft.trackworktime.event.Deleted

intent extras:

  • id: number uniquely identifying an event
  • date: the event's date, formatted YYYY-MM-DD
  • time: the event's time, formatted HH:MM:SS
  • timezone_offset: offset in standard format, e.g. +02:00
  • timezone_offset_minutes: offset in minutes, e.g. 120
  • type_id: number uniquely identifying the event's type (0=clock-out / 1=clock-in)
  • type: name of the event's type (CLOCK_IN or CLOCK_OUT)
  • task_id: number uniquely identifying the event's task (not available on clock-out events)
  • task: name of the event's task (not available on clock-out events)
  • comment: only available if the user provided it

(Aside: This might be the fastest feature implementation yet, less than 12 hours from requested to done. 😀)

Woo, thank you! :)

Is there a good way in the intent to tell if this is a change to the current state, or if instead the user is doing something like a multi-insert?

Now there is, see the above commit message. 😉

BTW: Events from restoring a backup will not create broadcast intents.

Wonderful! Thank you! :)

I look forward to trying it.