You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/action-queue.md
+59-6Lines changed: 59 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,65 @@
2
2
3
3
The action queue automatically groups rapid, consecutive calls to `execute_action_group()` into a single ActionGroup execution. This minimizes the number of API calls and helps prevent rate limiting issues, such as `TooManyRequestsError`, `TooManyConcurrentRequestsError`, `TooManyExecutionsError`, or `ExecutionQueueFullError` which can occur if actions are sent individually in quick succession.
4
4
5
-
Important limitation:
6
-
- Gateways only allow a single action per device in each action group. The queue
7
-
merges commands for the same `device_url` into a single action to keep the
8
-
batch valid and preserve command order for that device.
9
-
- If you pass multiple actions for the same `device_url` in a single
10
-
`execute_action_group()` call, the queue will merge them for you.
5
+
## How batching and merging works
6
+
7
+
The Overkiz API uses three levels of nesting:
8
+
9
+
-**Command** — a single device instruction (e.g. `close`, `setClosure(50)`)
10
+
-**Action** — one device URL + one or more commands
11
+
-**ActionGroup** — a batch of actions submitted as a single API call
12
+
13
+
The gateway enforces **one action per device** in each action group. The queue handles this automatically: when multiple actions target the same `device_url`, their commands are merged into a single action while preserving order.
14
+
15
+
### Different devices — no merging needed
16
+
17
+
Three commands for three different devices produce three actions in one action group:
18
+
19
+
```python
20
+
# These three calls arrive within the delay window:
0 commit comments