Let's focus on a common need. A BLF key to change from Night to Day mode, so it can be toggle anytime, but also to be automatic triggered at specified time.
The core of this feature is a Flow, so let's start creating a flow containing the definition of a variable used to hold the status.