Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ config.yaml
config.yaml.backup
identity.json

# Distribution Radio Settings
radio_settings_dist.json
# Data
data/

Expand Down
5 changes: 3 additions & 2 deletions repeater/web/api_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def needs_setup(self):
@cherrypy.expose
@cherrypy.tools.json_out()
def hardware_options(self):
"""Get available hardware configurations from radio-settings.json"""
"""Get available hardware configurations from radio-settings-dist.json or radio-settings.json"""
try:
import json

Expand All @@ -322,10 +322,11 @@ def hardware_options(self):
or "/var/lib/pymc_repeater"
)
config_dir = Path(storage_dir_cfg)
installed_dist_path = config_dir / 'radio-settings-dist.json'
installed_path = config_dir / "radio-settings.json"
dev_path = os.path.join(os.path.dirname(__file__), "..", "..", "radio-settings.json")

hardware_file = str(installed_path) if installed_path.exists() else dev_path
hardware_file = str(installed_dist_path) if installed_dist_path.exists() else str(installed_path) if installed_path.exists() else dev_path
hardware_list = []

if os.path.exists(hardware_file):
Expand Down