def _set_default_cycle_rate(cycle_rate: float, subcategory_id: int) -> float:
    """Set the default cycling rate for switches.

    :param cycle_rate: the current cycling rate.
    :param subcategory_id: the subcategory ID of the switch with missing defaults.
    :return: _n_cycles
    :rtype: float
    """
    if cycle_rate > 0.0:
        return cycle_rate

    try:
        return {
            1: 1.0,
            2: 1.0,
            3: 30.0,
            4: 1.0,
        }[subcategory_id]
    except KeyError:
        return 0.0