My phone does not have a data restriction on hotspot so im gonna make my own with flow. Before i go ahead, thought id get confirmation on my theory of how to structure the flow.
1. Store bytes to var when a device connects.
2. Either use a sleep or another flow to execute with periodic timer to check bytes transfered again.
3. Subtract first bytes stored by the second check.
4. If total bytes reached or exceeded value then disconnect and switch off hotspot.
5. If value not reached or exceeded then repeat sleep or continue periodic check.
6. Once device is disconnected, (if using periodic timer) disable flow.
Notes. Id guess i will have to store the results to var to add to next results if value was not reached or exceeded in order to get the accurate totals.
This should work just fine yeah?
Im fairly confident i know all the functions and operators, etc.
- Script obviously for vars and calculations
- Sleep (option one)
- Periodic timer (option two)
- Expression
- Set flow state (if using periodic timer)
- set wifi tethering state
- Notification displayed on status bar
(Currently the only way i can detect connected device on hotspot)
- execute flow (if using periodic timer)
- init vars network traffic
That should be about it i think. Lol its different when planning it like this. I usually just build as i go
Tethering data restriction
Moderator: Martin
Re: Tethering data restriction
Yes, approximately that is the concept. Just use periodic timer instead of sleep, it has less wakelock. The starting trigger of enabling the periodic timer flow can be the notification of tethering. The disabling also can be check from the notification. Usually the phone give info about how many device connected.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Tethering data restriction
Yepyep my thoughts exactly. Thanks