import json


def loadSettings(save):
    """load ON, OFF and VOLUME_THRESHOLD settings from a file"""
    try:
        with open("./settings/" + save+".json", "r") as f:
            data = json.load(f)
            print("Loaded settings")
            return data["off"], data["on"], data["vol"]
    except Exception as e:
        raise OSError("Invalid setting name: " + save)