1
0
mirror of https://github.com/natekspencer/hacs-oasis_mini.git synced 2025-11-17 01:23:43 -05:00

Add additional features

This commit is contained in:
Nathan Spencer
2024-07-30 23:44:43 -06:00
parent e77804ec0d
commit 3b90603bef
11 changed files with 217 additions and 35 deletions

View File

@@ -27,8 +27,8 @@ def draw_svg(track: dict, progress: int, model_id: str) -> str | None:
if progress is not None:
paths = svg_content.split("L")
total = track.get("reduced_svg_content", {}).get(model_id, len(paths))
percent = (100 * progress) / total
progress = math.floor((percent / 100) * len(paths))
percent = min((100 * progress) / total, 100)
progress = math.floor((percent / 100) * (len(paths) - 1))
svg = Element(
"svg",