Skip to content

Commit c19699f

Browse files
committed
Add scheduling example for persisted action groups with dynamic timestamp
1 parent 7f33e3e commit c19699f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/device-control.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ history = await client.get_execution_history()
261261
Action groups can be stored on the server (like saved scenes). Use these methods to list and execute them:
262262

263263
```python
264+
import time
265+
264266
# List all persisted action groups
265267
action_groups = await client.get_action_groups()
266268

@@ -270,8 +272,10 @@ for ag in action_groups:
270272
# Execute a persisted action group by OID
271273
exec_id = await client.execute_persisted_action_group(ag.oid)
272274

273-
# Schedule for future execution (Unix timestamp)
274-
trigger_id = await client.schedule_persisted_action_group(ag.oid, timestamp=1735689600)
275+
# Schedule for future execution (e.g. 1 hour from now)
276+
trigger_id = await client.schedule_persisted_action_group(
277+
ag.oid, timestamp=int(time.time()) + 3600
278+
)
275279
```
276280

277281
## Limitations and rate limits

0 commit comments

Comments
 (0)