def _decay_seconds(index: int, decay_config) -> float:
    """Return duration in seconds the segment should stay on.

    Only called during init to create a lookup table, for speed.

    Parameters
    ----------
    index : int
        The LED segment index.

    Return
    ------
    float
        Time in milliseconds to stay lit up.
    """
    for limit, ms in reversed(decay_config):
        if index >= limit:
            return ms / 1000
    assert False, "DECAY_MS table is messed up?"
    return 0