Moved battery calculations into here from jeenode