@classmethod
def from_bool(cls, action):
    """Maps from a bool or None to toggle."""
    if action is None:
        return cls.toggle
    elif action:
        return cls.on
    else:
        return cls.off
