def _remove_device_types(name, device_types):
    """Strip device types from a string.

    August stores the name as Master Bed Lock
    or Master Bed Door. We can come up with a
    reasonable suggestion by removing the supported
    device types from the string.
    """
    lower_name = name.lower()
    for device_type in device_types:
        device_type_with_space = f" {device_type}"
        if lower_name.endswith(device_type_with_space):
            lower_name = lower_name[: -len(device_type_with_space)]
    return name[: len(lower_name)]