mirror of
https://github.com/natekspencer/hacs-oasis_mini.git
synced 2025-11-16 09:03:50 -05:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21fd8a63ba | ||
|
|
552339665f | ||
|
|
85449a5363 | ||
|
|
d2bc89bdd7 | ||
|
|
06008e8f4c | ||
|
|
9fdfd8129f | ||
|
|
f9237927d9 | ||
|
|
dcd8db52f5 | ||
|
|
86cf060af0 | ||
|
|
d7a803abc7 | ||
|
|
a1bb4c78fb | ||
|
|
b5b3e691e2 | ||
|
|
52b741fb71 | ||
|
|
dc9f21b332 | ||
|
|
002898de97 | ||
|
|
1296b309d4 | ||
|
|
9cb8b6d398 | ||
|
|
a6022df49d | ||
|
|
839ba6ff35 | ||
|
|
39b333be8e | ||
|
|
2afb8acf0e | ||
|
|
50f7b270f2 | ||
|
|
802ce0f9a8 | ||
|
|
2f25218df5 | ||
|
|
de36b6ea67 | ||
|
|
4e370d441c | ||
|
|
cf8e744fa4 | ||
|
|
f04438cac8 | ||
|
|
8fbf7664b1 | ||
|
|
5d7176ebaa | ||
|
|
005a621816 | ||
|
|
2feba20b76 |
@@ -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(),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -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",
|
||||
}
|
||||
|
||||
@@ -32,6 +34,7 @@ AUTOPLAY_MAP = {
|
||||
"2": "5 minutes",
|
||||
"3": "10 minutes",
|
||||
"4": "30 minutes",
|
||||
"5": "24 hours",
|
||||
}
|
||||
|
||||
LED_EFFECTS: Final[dict[str, str]] = {
|
||||
@@ -50,6 +53,33 @@ 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"
|
||||
@@ -228,7 +258,7 @@ class OasisMini:
|
||||
"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(values[16 + shift]),
|
||||
"autoplay": AUTOPLAY_MAP.get(value := values[16 + shift], value),
|
||||
"autoclean": _bit_to_bool(values[17 + shift])
|
||||
if len(values) > 17
|
||||
else False,
|
||||
@@ -330,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": ""})
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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