SMBSync2 icon indicating copy to clipboard operation
SMBSync2 copied to clipboard

[Feature request] Trigger sync when device is attached to charger

Open H34dl3ss opened this issue 3 years ago • 5 comments

I understand, this can be achieved by third party apps (tasker) and I will do on my device, but less tech savvy people (my wife) don't know/use/want tasker and it would require to run that app just for this specific use case. Any chance to have this feature in the smbsync2 app? Thanks ahead!

H34dl3ss avatar May 20 '21 11:05 H34dl3ss

Hi,

I think it would be annoying to simply start syncing when the battery starts charging. As a workaround, you can register a shortcut on the home screen to start syncing in two actions.

  • Show home screen
  • Tap SMBSync2 shortcut

How to register a shortcut :

  1. Long tap SMBSync2 icon image
  2. Tap "Widgets" image
  3. Touch & hold to pick up a widget image

Best regards.

Sentaroh avatar May 22 '21 12:05 Sentaroh

Why do you think it could be annoying? There is already the option to "start sync only while charging". But it needs the schedule to be true as "second condition" as well. Unfortunately the are no fixed hours where the device is charging. I could set the schedule to run every 10 min. for example in conjunction with the "sync only while charging" but this may keep the device busy unnecessarily.

H34dl3ss avatar May 22 '21 20:05 H34dl3ss

Hi,

Why do you think it could be annoying?

If you always start syncing when charging is started, it will often cancel the sync that was started.

  • Charging is started outside of home
  • Frequent charging (due to battery consumption from long calls or games)

Please use a shortcut or an automation app such as Tasker.

Sentaroh avatar May 23 '21 21:05 Sentaroh

I'd like to have this feature as well. I only charge my phone once every few days, so I don't think it would be annoying for me. For other users, this trigger could be further enhanced with the following options:

  • Only trigger if not successful in the last N hours (frequent charging is no longer an issue).
  • Only trigger if wifi SSID is X. See this stackoverflow answer for how to get SSID in newer Android versions. (charging outside home is not an issue).
  • Only trigger if a particular IP pings, as an alternative to SSID detection.
  • Start M minutes after charging has started (in case people like to plugin for a quick minute to transfer a file or something).

There is no good open source alternative for Tasker and it's way too intrusive to install for something like this.

mohrezaei avatar Nov 18 '21 07:11 mohrezaei

I agree; the app I was previously using had the ability to delay sync start instead of failing.

This way I had a single schedule (00:00 daily, when charging) which would run immediately if already charging or immediately when plugged in if overdue.

SytheZN avatar Nov 28 '21 22:11 SytheZN