mirror of
https://github.com/natekspencer/hacs-oasis_mini.git
synced 2025-11-18 18:13:41 -05:00
Compare commits
14 Commits
dc9f21b332
...
1.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21fd8a63ba | ||
|
|
552339665f | ||
|
|
85449a5363 | ||
|
|
d2bc89bdd7 | ||
|
|
06008e8f4c | ||
|
|
9fdfd8129f | ||
|
|
f9237927d9 | ||
|
|
dcd8db52f5 | ||
|
|
86cf060af0 | ||
|
|
d7a803abc7 | ||
|
|
a1bb4c78fb | ||
|
|
b5b3e691e2 | ||
|
|
52b741fb71 | ||
|
|
50f7b270f2 |
@@ -61,6 +61,11 @@ DESCRIPTORS = (
|
||||
translation_key="random_track",
|
||||
press_fn=play_random_track,
|
||||
),
|
||||
OasisMiniButtonEntityDescription(
|
||||
key="sleep",
|
||||
translation_key="sleep",
|
||||
press_fn=lambda device: device.async_sleep(),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ from urllib.parse import urljoin
|
||||
from aiohttp import ClientResponseError, ClientSession
|
||||
|
||||
from .const import TRACKS
|
||||
from .utils import _bit_to_bool, decrypt_svg_content
|
||||
from .utils import _bit_to_bool, _parse_int, decrypt_svg_content
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -20,9 +20,11 @@ STATUS_CODE_MAP = {
|
||||
3: "centering",
|
||||
4: "playing",
|
||||
5: "paused",
|
||||
6: "sleeping",
|
||||
9: "error",
|
||||
11: "updating",
|
||||
13: "downloading",
|
||||
14: "busy",
|
||||
15: "live",
|
||||
}
|
||||
|
||||
@@ -51,12 +53,39 @@ LED_EFFECTS: Final[dict[str, str]] = {
|
||||
"12": "Follow Rainbow",
|
||||
"13": "Chasing Comet",
|
||||
"14": "Gradient Follow",
|
||||
"15": "Cumulative Fill",
|
||||
"16": "Multi Comets A",
|
||||
"17": "Rainbow Chaser",
|
||||
"18": "Twinkle Lights",
|
||||
"19": "Tennis Game",
|
||||
"20": "Breathing Exercise 4-7-8",
|
||||
"21": "Cylon Scanner",
|
||||
"22": "Palette Mode",
|
||||
"23": "Aurora Flow",
|
||||
"24": "Colorful Drops",
|
||||
"25": "Color Snake",
|
||||
"26": "Flickering Candles",
|
||||
"27": "Digital Rain",
|
||||
"28": "Center Explosion",
|
||||
"29": "Rainbow Plasma",
|
||||
"30": "Comet Race",
|
||||
"31": "Color Waves",
|
||||
"32": "Meteor Storm",
|
||||
"33": "Firefly Flicker",
|
||||
"34": "Ripple",
|
||||
"35": "Jelly Bean",
|
||||
"36": "Forest Rain",
|
||||
"37": "Multi Comets",
|
||||
"38": "Multi Comets with Background",
|
||||
"39": "Rainbow Fill",
|
||||
"40": "White Red Comet",
|
||||
"41": "Color Comets",
|
||||
}
|
||||
|
||||
CLOUD_BASE_URL = "https://app.grounded.so"
|
||||
|
||||
BALL_SPEED_MAX: Final = 1000
|
||||
BALL_SPEED_MIN: Final = 200
|
||||
BALL_SPEED_MAX: Final = 400
|
||||
BALL_SPEED_MIN: Final = 100
|
||||
LED_SPEED_MAX: Final = 90
|
||||
LED_SPEED_MIN: Final = -90
|
||||
|
||||
@@ -210,25 +239,29 @@ class OasisMini:
|
||||
raw_status = await self._async_get(params={"GETSTATUS": ""})
|
||||
_LOGGER.debug("Status: %s", raw_status)
|
||||
values = raw_status.split(";")
|
||||
playlist = [int(track) for track in values[3].split(",") if track]
|
||||
playlist = [_parse_int(track) for track in values[3].split(",") if track]
|
||||
shift = len(values) - 18 if len(values) > 17 else 0
|
||||
status = {
|
||||
"status_code": int(values[0]), # see status code map
|
||||
"error": int(values[1]), # noqa: E501; error, 0 = none, and 10 = ?, 18 = can't download?
|
||||
"ball_speed": int(values[2]), # 200 - 1000
|
||||
"status_code": _parse_int(values[0]), # see status code map
|
||||
"error": _parse_int(values[1]), # noqa: E501; error, 0 = none, and 10 = ?, 18 = can't download?
|
||||
"ball_speed": _parse_int(values[2]), # 200 - 1000
|
||||
"playlist": playlist,
|
||||
"playlist_index": min(int(values[4]), len(playlist)), # index of above
|
||||
"progress": int(values[5]), # 0 - max svg path
|
||||
"playlist_index": min(_parse_int(values[4]), len(playlist)), # noqa: E501; index of above
|
||||
"progress": _parse_int(values[5]), # 0 - max svg path
|
||||
"led_effect": values[6], # led effect (code lookup)
|
||||
"led_color_id": values[7], # led color id?
|
||||
"led_speed": int(values[8]), # -90 - 90
|
||||
"brightness": int(values[9]) if values[10] else 0, # noqa: E501; 0 - 200 in app, but seems to be 0 (off) to 304 (max), then repeats
|
||||
"color": values[10] or None, # hex color code
|
||||
"busy": _bit_to_bool(values[11]), # noqa: E501; device is busy (downloading track, centering, software update)?
|
||||
"download_progress": int(values[12]),
|
||||
"max_brightness": int(values[13]),
|
||||
"wifi_connected": _bit_to_bool(values[14]),
|
||||
"repeat_playlist": _bit_to_bool(values[15]),
|
||||
"autoplay": AUTOPLAY_MAP.get(value := values[16], value),
|
||||
"led_speed": _parse_int(values[8]), # -90 - 90
|
||||
"brightness": _parse_int(values[9]), # noqa: E501; 0 - 200 in app, but seems to be 0 (off) to 304 (max), then repeats
|
||||
"color": values[10] if "#" in values[10] else None, # hex color code
|
||||
"busy": _bit_to_bool(values[11 + shift]), # noqa: E501; device is busy (downloading track, centering, software update)?
|
||||
"download_progress": _parse_int(values[12 + shift]),
|
||||
"max_brightness": _parse_int(values[13 + shift]),
|
||||
"wifi_connected": _bit_to_bool(values[14 + shift]),
|
||||
"repeat_playlist": _bit_to_bool(values[15 + shift]),
|
||||
"autoplay": AUTOPLAY_MAP.get(value := values[16 + shift], value),
|
||||
"autoclean": _bit_to_bool(values[17 + shift])
|
||||
if len(values) > 17
|
||||
else False,
|
||||
}
|
||||
for key, value in status.items():
|
||||
if (old_value := getattr(self, key, None)) != value:
|
||||
@@ -327,6 +360,10 @@ class OasisMini:
|
||||
"""Set repeat playlist."""
|
||||
await self._async_command(params={"WRIREPEATJOB": 1 if repeat else 0})
|
||||
|
||||
async def async_sleep(self) -> None:
|
||||
"""Send sleep command."""
|
||||
await self._async_command(params={"CMDSLEEP": ""})
|
||||
|
||||
async def async_stop(self) -> None:
|
||||
"""Send stop command."""
|
||||
await self._async_command(params={"CMDSTOP": ""})
|
||||
|
||||
@@ -109,6 +109,14 @@
|
||||
"1": 28457
|
||||
}
|
||||
},
|
||||
"8461": {
|
||||
"id": 8461,
|
||||
"name": "7 Center",
|
||||
"author": "Walter Melanson",
|
||||
"image": "2025/06/aed480b0cc351676f0321c5a5f56ae22.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"131": {
|
||||
"id": 131,
|
||||
"name": "A Star",
|
||||
@@ -261,6 +269,22 @@
|
||||
"1": 18767
|
||||
}
|
||||
},
|
||||
"8503": {
|
||||
"id": 8503,
|
||||
"name": "Angry Badger",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/07/e322d3ade30f0a0e9af497a13257efab.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"8341": {
|
||||
"id": 8341,
|
||||
"name": "Angry Cat",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/0f1b01f83b22e45cdd3c4a1d21eac17f.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"2798": {
|
||||
"id": 2798,
|
||||
"name": "Angry T-rex",
|
||||
@@ -366,6 +390,16 @@
|
||||
"1": 7788
|
||||
}
|
||||
},
|
||||
"8306": {
|
||||
"id": 8306,
|
||||
"name": "Astronaut Girl and Ted Bear",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/299b36d14745a553093cea7e330810d0.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": {
|
||||
"1": 51504
|
||||
}
|
||||
},
|
||||
"1961": {
|
||||
"id": 1961,
|
||||
"name": "Asymmetrical Spiral In to Out",
|
||||
@@ -570,6 +604,14 @@
|
||||
"1": 6682
|
||||
}
|
||||
},
|
||||
"8333": {
|
||||
"id": 8333,
|
||||
"name": "Beatle and banjo",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/9a0081f4ad7aaacae6c91822ba5fd3a0.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"48": {
|
||||
"id": 48,
|
||||
"name": "Beatle01",
|
||||
@@ -715,6 +757,14 @@
|
||||
"1": 3920
|
||||
}
|
||||
},
|
||||
"8485": {
|
||||
"id": 8485,
|
||||
"name": "Bodhi tree",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/637f117735a86aa56a9eb590d7d805ac.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"7915": {
|
||||
"id": 7915,
|
||||
"name": "Bonsai tree",
|
||||
@@ -725,6 +775,14 @@
|
||||
"1": 55010
|
||||
}
|
||||
},
|
||||
"8511": {
|
||||
"id": 8511,
|
||||
"name": "Botanic Spiral",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/07/3a2c85f1216662881ae2ee783382734f.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"56": {
|
||||
"id": 56,
|
||||
"name": "Branch",
|
||||
@@ -1006,6 +1064,14 @@
|
||||
"1": 28146
|
||||
}
|
||||
},
|
||||
"8441": {
|
||||
"id": 8441,
|
||||
"name": "Cherry Blossom Bonsai",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/f1a6e7624e05a330c1d439001f3f09f5.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"7478": {
|
||||
"id": 7478,
|
||||
"name": "ChevronWipe OO",
|
||||
@@ -1239,6 +1305,14 @@
|
||||
},
|
||||
"updated_at": "2024-08-04T16:01:33.000000Z"
|
||||
},
|
||||
"8586": {
|
||||
"id": 8586,
|
||||
"name": "Clover Star",
|
||||
"author": "Walter Melanson",
|
||||
"image": "2025/07/a7bbfe0d796ccd16fbe1cb20ee865bb9.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"505": {
|
||||
"id": 505,
|
||||
"name": "Coarse Hilbert Wiper",
|
||||
@@ -1336,6 +1410,22 @@
|
||||
"1": 2550
|
||||
}
|
||||
},
|
||||
"8573": {
|
||||
"id": 8573,
|
||||
"name": "Coffee Table Spiral In to Out",
|
||||
"author": "Oasis Mini",
|
||||
"image": "2025/07/3ab8079a9fcd56febcfcb0caa8a033e7.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"8574": {
|
||||
"id": 8574,
|
||||
"name": "Coffee Table Spiral Out to In",
|
||||
"author": "Oasis Mini",
|
||||
"image": "2025/07/6dc91c7431d03817425010d2beffde8e.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"1300": {
|
||||
"id": 1300,
|
||||
"name": "Collapse",
|
||||
@@ -2120,6 +2210,14 @@
|
||||
},
|
||||
"updated_at": "2024-08-04T15:58:51.000000Z"
|
||||
},
|
||||
"8438": {
|
||||
"id": 8438,
|
||||
"name": "Envision IO",
|
||||
"author": "M. Frost",
|
||||
"image": "2025/06/0a3dd49c9f63cbe6a6b88552c945c5a8.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"1977": {
|
||||
"id": 1977,
|
||||
"name": "EpiCycloid IO",
|
||||
@@ -2191,6 +2289,30 @@
|
||||
"1": 23677
|
||||
}
|
||||
},
|
||||
"8340": {
|
||||
"id": 8340,
|
||||
"name": "Father's day",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/fc9a8b2b806abdde10a09cb6ac4ef730.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"8332": {
|
||||
"id": 8332,
|
||||
"name": "Father’s Day 2",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/ae1d6cb842451f40dc7d72b6b86f6be5.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"8364": {
|
||||
"id": 8364,
|
||||
"name": "Father’s Day family",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/771378665cddca30a235d35e058eb4eb.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"33": {
|
||||
"id": 33,
|
||||
"name": "Fibonacci Shell",
|
||||
@@ -2850,6 +2972,14 @@
|
||||
"1": 6124
|
||||
}
|
||||
},
|
||||
"8330": {
|
||||
"id": 8330,
|
||||
"name": "Hamster wheel",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/d0391f5356f13153eb37d1dba152624b.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"4163": {
|
||||
"id": 4163,
|
||||
"name": "Hand",
|
||||
@@ -3084,6 +3214,14 @@
|
||||
"1": 22478
|
||||
}
|
||||
},
|
||||
"8510": {
|
||||
"id": 8510,
|
||||
"name": "Heartleaf Philodendron",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/07/c5256b608155eb20cf4a26bc78a8a62c.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"6414": {
|
||||
"id": 6414,
|
||||
"name": "Hearts",
|
||||
@@ -3135,6 +3273,14 @@
|
||||
"1": 67309
|
||||
}
|
||||
},
|
||||
"8498": {
|
||||
"id": 8498,
|
||||
"name": "Hibiscus Flower",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/111f43d73c3dfe1cd836ee70592b7673.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"147": {
|
||||
"id": 147,
|
||||
"name": "Hilbert",
|
||||
@@ -3335,6 +3481,22 @@
|
||||
},
|
||||
"updated_at": "2024-08-04T15:58:47.000000Z"
|
||||
},
|
||||
"8380": {
|
||||
"id": 8380,
|
||||
"name": "Imaginative Drawning",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/e8f01bb74da1aabd87a941a38595d214.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"8403": {
|
||||
"id": 8403,
|
||||
"name": "Imaginative Sand Drawning",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/180e2727632e3e92791e8160f993c550.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"2686": {
|
||||
"id": 2686,
|
||||
"name": "Infinite Rose",
|
||||
@@ -3529,6 +3691,16 @@
|
||||
"1": 40782
|
||||
}
|
||||
},
|
||||
"8096": {
|
||||
"id": 8096,
|
||||
"name": "Kids on Rollercoaster",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/05/10064d86585fcec89a36563e5e06b3a8.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": {
|
||||
"1": 28858
|
||||
}
|
||||
},
|
||||
"2796": {
|
||||
"id": 2796,
|
||||
"name": "Killer Wale",
|
||||
@@ -3882,6 +4054,14 @@
|
||||
},
|
||||
"updated_at": "2024-08-04T15:58:56.000000Z"
|
||||
},
|
||||
"8361": {
|
||||
"id": 8361,
|
||||
"name": "Magical Reading Time",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/7033fd8203a39e1410059c74df32d12d.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"5486": {
|
||||
"id": 5486,
|
||||
"name": "Mahatma Gandhi",
|
||||
@@ -3892,6 +4072,14 @@
|
||||
"1": 44947
|
||||
}
|
||||
},
|
||||
"8425": {
|
||||
"id": 8425,
|
||||
"name": "Mammoth",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/b8a285c6ad730abaa0d89690be5abb38.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"64": {
|
||||
"id": 64,
|
||||
"name": "Mandala",
|
||||
@@ -4025,6 +4213,16 @@
|
||||
"1": 12076
|
||||
}
|
||||
},
|
||||
"8293": {
|
||||
"id": 8293,
|
||||
"name": "Mermaid jumping out the Sea",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/8ee24bf59d0a0d80ffbcbf1b953a999c.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": {
|
||||
"1": 51679
|
||||
}
|
||||
},
|
||||
"5908": {
|
||||
"id": 5908,
|
||||
"name": "Mesmerizing Squiggles",
|
||||
@@ -4076,6 +4274,16 @@
|
||||
"1": 11589
|
||||
}
|
||||
},
|
||||
"8270": {
|
||||
"id": 8270,
|
||||
"name": "Minotaur",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/05/9ca941c4daabc23960b52c9f0e522f55.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": {
|
||||
"1": 45112
|
||||
}
|
||||
},
|
||||
"3669": {
|
||||
"id": 3669,
|
||||
"name": "ML256",
|
||||
@@ -4148,6 +4356,14 @@
|
||||
},
|
||||
"updated_at": "2024-08-04T15:58:53.000000Z"
|
||||
},
|
||||
"8508": {
|
||||
"id": 8508,
|
||||
"name": "Monstera Deliciosa",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/07/af2e6ac2a5c92705eb8f2fcfea5ac928.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"1778": {
|
||||
"id": 1778,
|
||||
"name": "Monstera leaves",
|
||||
@@ -4457,6 +4673,22 @@
|
||||
"1": 29643
|
||||
}
|
||||
},
|
||||
"8491": {
|
||||
"id": 8491,
|
||||
"name": "Passion Flower",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/f743035a2c869d16267e18feba47371b.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"8502": {
|
||||
"id": 8502,
|
||||
"name": "Passion Flower power",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/e87580e434cc8cec9c4c28bcf1c0acd2.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"221": {
|
||||
"id": 221,
|
||||
"name": "Pattern 3",
|
||||
@@ -4712,6 +4944,14 @@
|
||||
"1": 24258
|
||||
}
|
||||
},
|
||||
"8483": {
|
||||
"id": 8483,
|
||||
"name": "Poison Ivy",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/d33ab742dfe9ce327a7a9746e1a8a096.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"1049": {
|
||||
"id": 1049,
|
||||
"name": "PolarValentine",
|
||||
@@ -4722,6 +4962,14 @@
|
||||
"1": 29754
|
||||
}
|
||||
},
|
||||
"8464": {
|
||||
"id": 8464,
|
||||
"name": "Polka Dot Begonia",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/46cd2ffdf53ab439af8edd4ccecad3be.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"995": {
|
||||
"id": 995,
|
||||
"name": "Polygon Fisheye",
|
||||
@@ -4732,6 +4980,14 @@
|
||||
"1": 7020
|
||||
}
|
||||
},
|
||||
"8588": {
|
||||
"id": 8588,
|
||||
"name": "Polygons",
|
||||
"author": "Walter Melanson",
|
||||
"image": "2025/07/eee6096038e9b6a70808fdddcbe1fef7.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"559": {
|
||||
"id": 559,
|
||||
"name": "Polymath",
|
||||
@@ -4743,6 +4999,16 @@
|
||||
},
|
||||
"updated_at": "2024-08-04T16:01:40.000000Z"
|
||||
},
|
||||
"8223": {
|
||||
"id": 8223,
|
||||
"name": "Portrait of a Man",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/05/7290ec56cc7d69a575848d6d2bdd9de2.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": {
|
||||
"1": 29046
|
||||
}
|
||||
},
|
||||
"7708": {
|
||||
"id": 7708,
|
||||
"name": "Present2",
|
||||
@@ -4774,6 +5040,14 @@
|
||||
"1": 33688
|
||||
}
|
||||
},
|
||||
"8431": {
|
||||
"id": 8431,
|
||||
"name": "Pufferfish",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/b97dcd4158361728d4908fcff652ead7.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"5184": {
|
||||
"id": 5184,
|
||||
"name": "Pyrohedron",
|
||||
@@ -5373,6 +5647,22 @@
|
||||
"1": 4665
|
||||
}
|
||||
},
|
||||
"8575": {
|
||||
"id": 8575,
|
||||
"name": "Side Table Spiral In to Out",
|
||||
"author": "Oasis Mini",
|
||||
"image": "2025/07/f3956248c0f7f5c281c52d85b7654ec9.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"8576": {
|
||||
"id": 8576,
|
||||
"name": "Side Table Spiral Out to In",
|
||||
"author": "Oasis Mini",
|
||||
"image": "2025/07/ffb61a26562e26efb34f8706c7ba52ec.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"149": {
|
||||
"id": 149,
|
||||
"name": "Sierpenski",
|
||||
@@ -5742,6 +6032,16 @@
|
||||
},
|
||||
"updated_at": "2024-08-23T15:52:53.000000Z"
|
||||
},
|
||||
"8200": {
|
||||
"id": 8200,
|
||||
"name": "Space Orbital Satellite",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/05/c068dab20332a9c7d978b2e4f3bb5f0a.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": {
|
||||
"1": 53094
|
||||
}
|
||||
},
|
||||
"160": {
|
||||
"id": 160,
|
||||
"name": "Spaceman",
|
||||
@@ -6130,6 +6430,14 @@
|
||||
"1": 3187
|
||||
}
|
||||
},
|
||||
"8459": {
|
||||
"id": 8459,
|
||||
"name": "Spoted Rex Begonia",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/5a16cae9f3a6b5d870a6e2a6fd4506fe.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"3047": {
|
||||
"id": 3047,
|
||||
"name": "Sprioneering",
|
||||
@@ -6774,6 +7082,14 @@
|
||||
},
|
||||
"updated_at": "2024-08-04T15:58:54.000000Z"
|
||||
},
|
||||
"8497": {
|
||||
"id": 8497,
|
||||
"name": "T-Rex Skull",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/8f6e693fa071f8be3b084032d78580a1.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"7276": {
|
||||
"id": 7276,
|
||||
"name": "Takeshi Ren",
|
||||
@@ -6834,6 +7150,14 @@
|
||||
"1": 30263
|
||||
}
|
||||
},
|
||||
"8351": {
|
||||
"id": 8351,
|
||||
"name": "Test 2",
|
||||
"author": "Thalia",
|
||||
"image": "2025/06/f847fe13b2b607a5a08c8a43ca3f8c1a.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"5965": {
|
||||
"id": 5965,
|
||||
"name": "Test Maze 2",
|
||||
@@ -6884,6 +7208,14 @@
|
||||
"1": 58681
|
||||
}
|
||||
},
|
||||
"8428": {
|
||||
"id": 8428,
|
||||
"name": "The Buddah’s Head 2",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/71bad0197fc33b677b29bdd063d50b59.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"6998": {
|
||||
"id": 6998,
|
||||
"name": "The Camel",
|
||||
@@ -6894,6 +7226,16 @@
|
||||
"1": 61839
|
||||
}
|
||||
},
|
||||
"8287": {
|
||||
"id": 8287,
|
||||
"name": "The Children’s Band",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/05/417102e64576ea780fbe75c78ad46497.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": {
|
||||
"1": 58560
|
||||
}
|
||||
},
|
||||
"2836": {
|
||||
"id": 2836,
|
||||
"name": "The Drunk Starfish",
|
||||
@@ -6914,6 +7256,16 @@
|
||||
"1": 56023
|
||||
}
|
||||
},
|
||||
"8173": {
|
||||
"id": 8173,
|
||||
"name": "The Hunting owl",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/05/3381fb8cc890fbf59384a9b9bfc6a97e.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": {
|
||||
"1": 40884
|
||||
}
|
||||
},
|
||||
"223": {
|
||||
"id": 223,
|
||||
"name": "The Knot",
|
||||
@@ -7110,6 +7462,16 @@
|
||||
},
|
||||
"updated_at": "2024-08-04T15:59:30.000000Z"
|
||||
},
|
||||
"8111": {
|
||||
"id": 8111,
|
||||
"name": "Trash Basket Shot",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/05/318b90d771beea2fa7101fb75f7d6a2a.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": {
|
||||
"1": 35714
|
||||
}
|
||||
},
|
||||
"1272": {
|
||||
"id": 1272,
|
||||
"name": "Treble Clef",
|
||||
@@ -7262,6 +7624,16 @@
|
||||
"1": 20802
|
||||
}
|
||||
},
|
||||
"8216": {
|
||||
"id": 8216,
|
||||
"name": "Trojan Horse",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/05/4be2a1372bcd3b95083056173debfa45.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": {
|
||||
"1": 82837
|
||||
}
|
||||
},
|
||||
"247": {
|
||||
"id": 247,
|
||||
"name": "Tropical Frog",
|
||||
@@ -7549,6 +7921,16 @@
|
||||
"1": 13869
|
||||
}
|
||||
},
|
||||
"8098": {
|
||||
"id": 8098,
|
||||
"name": "Volcano Erupting",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/05/074085c68bfaf06ac512d55c80932464.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": {
|
||||
"1": 56965
|
||||
}
|
||||
},
|
||||
"1866": {
|
||||
"id": 1866,
|
||||
"name": "Vortex",
|
||||
@@ -7909,6 +8291,16 @@
|
||||
"1": 5667
|
||||
}
|
||||
},
|
||||
"8294": {
|
||||
"id": 8294,
|
||||
"name": "Wolf boy howling at the moon",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/2e9e48e885f6094cf6ad95d3538e2b41.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": {
|
||||
"1": 53660
|
||||
}
|
||||
},
|
||||
"77": {
|
||||
"id": 77,
|
||||
"name": "Wolf head",
|
||||
@@ -8024,6 +8416,14 @@
|
||||
},
|
||||
"updated_at": "2024-08-04T16:01:31.000000Z"
|
||||
},
|
||||
"8488": {
|
||||
"id": 8488,
|
||||
"name": "Zen Bambu and Stones",
|
||||
"author": "Otávio Bittencourt",
|
||||
"image": "2025/06/21cdeb1f40571b68578afa6844326936.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
},
|
||||
"4014": {
|
||||
"id": 4014,
|
||||
"name": "Zombie",
|
||||
@@ -8033,5 +8433,13 @@
|
||||
"reduced_svg_content": {
|
||||
"1": 21411
|
||||
}
|
||||
},
|
||||
"8593": {
|
||||
"id": 8593,
|
||||
"name": "ZSC Lions Stern",
|
||||
"author": "adi",
|
||||
"image": "2025/07/de61ce519b7e6946ed777d54f521a29c.svg",
|
||||
"clean_pattern": null,
|
||||
"reduced_svg_content": []
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,14 @@ def _bit_to_bool(val: str) -> bool:
|
||||
return val == "1"
|
||||
|
||||
|
||||
def _parse_int(val: str) -> int:
|
||||
"""Convert an int string to int."""
|
||||
try:
|
||||
return int(val)
|
||||
except Exception:
|
||||
return 0
|
||||
|
||||
|
||||
def draw_svg(track: dict, progress: int, model_id: str) -> str | None:
|
||||
"""Draw SVG."""
|
||||
if track and (svg_content := track.get("svg_content")):
|
||||
|
||||
@@ -41,6 +41,9 @@
|
||||
"button": {
|
||||
"random_track": {
|
||||
"name": "Play random track"
|
||||
},
|
||||
"sleep": {
|
||||
"name": "Sleep"
|
||||
}
|
||||
},
|
||||
"binary_sensor": {
|
||||
@@ -93,9 +96,11 @@
|
||||
"centering": "Centering",
|
||||
"playing": "Playing",
|
||||
"paused": "Paused",
|
||||
"sleeping": "Sleeping",
|
||||
"error": "Error",
|
||||
"updating": "Updating",
|
||||
"downloading": "Downloading",
|
||||
"busy": "Busy",
|
||||
"live": "Live drawing"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,9 @@
|
||||
"button": {
|
||||
"random_track": {
|
||||
"name": "Play random track"
|
||||
},
|
||||
"sleep": {
|
||||
"name": "Sleep"
|
||||
}
|
||||
},
|
||||
"binary_sensor": {
|
||||
@@ -93,9 +96,11 @@
|
||||
"centering": "Centering",
|
||||
"playing": "Playing",
|
||||
"paused": "Paused",
|
||||
"sleeping": "Sleeping",
|
||||
"error": "Error",
|
||||
"updating": "Updating",
|
||||
"downloading": "Downloading",
|
||||
"busy": "Busy",
|
||||
"live": "Live drawing"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user