Creates a plan from its three work intervals in microseconds, entering saver mode below 50% charge and critical below 20%, and leaving each lower mode once the charge is five points above the threshold that brought it on.
The charge below which the plan enters critical mode.
How far above a threshold the charge must climb before the plan leaves the lower mode.
The charge below which the plan enters saver mode.
Returns the work interval at a state of charge, in microseconds.
Returns the mode this plan calls for at a state of charge.
A charge that is not a number, such as a fuel gauge that failed to answer, is taken as critical.
Returns the mode, eased one step toward full duty while charging.
Returns the mode a node in current moves to at a new charge. It drops to a lower
mode as soon as the charge falls below that mode's threshold, and climbs back only
once the charge reaches the threshold plus the hysteresis margin, so a charge
wandering around a threshold keeps the node where it is.
Returns a copy of this plan with the hysteresis margin moved: how far above a
threshold the charge must climb before the plan leaves the lower mode. 0 switches
at the thresholds themselves; a margin below zero or not a number is taken as 0.
Returns a copy of this plan with the state-of-charge thresholds moved.
The work intervals a node uses in each mode, and where the modes change.