Files
MuditaOS/test/eq_setup.py
Bartosz Cichocki c7b1fde907 [MOS-492] Enable overriding audio profiles via harness
Profile modification is possible via python script
2022-06-15 11:03:39 +02:00

26 lines
725 B
Python

#!/usr/bin/env python
# Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
from harness.harness import Harness
from harness.api.developermode import SetEQ
import sys
import copy
harness = Harness.from_detect()
# pass EQ json file as an argument of this script. It can be both absolute or relative path.
file_path = sys.argv[1]
file_data = open(file_path,"r")
file_text = file_data.read()
file_data.close()
file_name = file_path.split('/')[-1]
print("Overriding "+file_name+" ...")
print("File data: \n"+file_text)
cmd = SetEQ(file_name,file_text)
ret = cmd.run(harness)
print("result: " + "OK" if ret.response.status == 200 else "Error!")