Assessing the impact of sensor-based task scheduling on battery lifetime in IoT devices