I got a sensor that returns time in minutes. The number I get is a single integer, for example 352.
I need to convert this number to hours and minutes, so in this case it would be 5 hours and 52 minutes. The goal is passing the result to a tts announcement in a human readable format.
Skimming through similar questions I didn’t find something that works.
Or well, with a small tweak actually for anyone else reading this. Had to add a rounding to the calculated values to get the hours and minutes as integers. So final code was: