try to power on then set scene

This commit is contained in:
2026-05-02 23:09:55 -04:00
parent ea1b2c90ae
commit 09df7c6ac3
2 changed files with 11 additions and 4 deletions
+11
View File
@@ -48,6 +48,17 @@ class GoveeApi:
await self.close() await self.close()
async def send_scene(self, scene_code: str): async def send_scene(self, scene_code: str):
power_payload = {
"msg": {
"cmd": "turn",
"data": {
"value": 1 # 1 = on, 0 = off
}
}
}
self._send(power_payload)
time.sleep(0.5)
segments = scene_code.split(",") segments = scene_code.split(",")
for i, segment in enumerate(segments): for i, segment in enumerate(segments):
payload = {"msg": {"cmd": "ptReal", "data": {"command": [segment]}}} payload = {"msg": {"cmd": "ptReal", "data": {"command": [segment]}}}
-4
View File
@@ -1,4 +0,0 @@
import govee
govee_api = govee.GoveeApi(device_ip="172.16.0.15")
govee_api.send_scene("owABAgT/AGQMACr//+YAADb//8k=,o//QAAIDAwAAAAAAAAAAAAAAAI4=,MwUKdwAAAAAAAAAAAAAAAAAAAEs=")