def METHOD_NAME(self, filename=None):
    # Load persistent settings from disk. If the file doesn't exist, create it
    if filename:
        self.filename = filename
    else:
        self.filename = os.path.join(
            self.common.build_persistent_dir(), f"{self.id}.json"
        )
    if os.path.exists(self.filename):
        try:
            with open(self.filename, "r") as f:
                self._settings = json.METHOD_NAME(f)
                self.fill_in_defaults()
                self.common.log("ModeSettings", "load", f"loaded {self.filename}")
                return
        except Exception:
            pass
    # If loading settings didn't work, create the settings file
    self.common.log("ModeSettings", "load", f"creating {self.filename}")
    self.fill_in_defaults()
    self.just_created = True