1
0
mirror of https://github.com/natekspencer/hacs-oasis_mini.git synced 2025-11-11 06:33:52 -05:00
Files
hacs-oasis_mini/custom_components/oasis_mini/pyoasismini/const.py
2024-08-03 17:31:30 -06:00

17 lines
422 B
Python

"""Constants."""
from __future__ import annotations
import json
import os
from typing import Any, Final
__TRACKS_FILE = os.path.join(os.path.dirname(__file__), "tracks.json")
try:
with open(__TRACKS_FILE, "r", encoding="utf8") as file:
TRACKS: Final[dict[int, dict[str, Any]]] = {
int(k): v for k, v in json.load(file).items()
}
except Exception: # ignore: broad-except
TRACKS = {}