by F. F.
Flow to post notifications based on configurable battery levels.
This flow posts notifications when the battery level falls under a configurable value or the specified charching target has been reached. Those notifications can be used to assign a custom tone to be played. The according notification channels are named 'Low battery' and 'Charging completed'.
The flow set contains 2 starting points - a service flow doing the processing and a configurator flow to administrate the options, which are stored persistently in a file.
It has been created and tested on a Google Pixel 4a (Android 11), so no warranties are given it will run smoothly on any other device.
Once the configurator flow modifies the settings, it provides them to the eventually running service flow within a broadcast message. Synchronization between the processing fiber and the blocking fibers monitoring the battery level and a possibly changed configuration in the service flow is done by applying 'Variables Give' and 'Variables Take' blocks.