plexus-python 0.11.3__py3-none-any.whl → 0.11.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- plexus/__init__.py +1 -1
- plexus/_skills/plexus-firmware/SKILL.md +1 -1
- plexus/ws.py +3 -4
- {plexus_python-0.11.3.dist-info → plexus_python-0.11.4.dist-info}/METADATA +3 -3
- {plexus_python-0.11.3.dist-info → plexus_python-0.11.4.dist-info}/RECORD +8 -8
- {plexus_python-0.11.3.dist-info → plexus_python-0.11.4.dist-info}/WHEEL +0 -0
- {plexus_python-0.11.3.dist-info → plexus_python-0.11.4.dist-info}/entry_points.txt +0 -0
- {plexus_python-0.11.3.dist-info → plexus_python-0.11.4.dist-info}/licenses/LICENSE +0 -0
plexus/__init__.py
CHANGED
|
@@ -61,7 +61,7 @@ Four things the gateway will reject you for. Get these right or nothing lands:
|
|
|
61
61
|
1. **The array is `points`.** `"metrics": [...]` returns `400 {"error":"'points' array is required"}`.
|
|
62
62
|
2. **Every point needs `class`**, either `"metric"` or `"event"`. There is no default.
|
|
63
63
|
3. **`timestamp` is a number, never a string.** An ISO-8601 string returns `points[i].timestamp must be a number`. Epoch **milliseconds**; a positive value below `1e12` is read as **seconds** and scaled for you, so either unit works as long as it's numeric.
|
|
64
|
-
4. **`source_id` must match `^[a-z0-9][a-z0-
|
|
64
|
+
4. **`source_id` must match `^[a-z0-9][a-z0-9._-]*$` (max 256 chars)** and is not deduplicated — two devices declaring the same id merge into one source. This is what SD-card clones do when they all boot as `raspberrypi`.
|
|
65
65
|
|
|
66
66
|
`timestamp` is optional. Omit it and the gateway stamps the point with its receive time — which is the right move on a device whose clock has never been NTP-synced. Per-point `tags` (a flat string→string map) are supported and optional.
|
|
67
67
|
|
plexus/ws.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""
|
|
2
2
|
WebSocket transport for the Plexus Python SDK.
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Implements the gateway's device wire protocol. Targets its
|
|
5
5
|
`/ws/device` endpoint and exchanges the same JSON frames:
|
|
6
6
|
|
|
7
7
|
client → {"type": "device_auth", "api_key": ..., "source_id": ...,
|
|
@@ -392,7 +392,7 @@ class WebSocketTransport:
|
|
|
392
392
|
command = msg.get("command") or ""
|
|
393
393
|
params = msg.get("params") or {}
|
|
394
394
|
|
|
395
|
-
# Ack immediately
|
|
395
|
+
# Ack immediately, per the gateway wire contract
|
|
396
396
|
self._send_frame({
|
|
397
397
|
"type": "command_result",
|
|
398
398
|
"id": cmd_id,
|
|
@@ -547,8 +547,7 @@ def _safe_json(raw: Any) -> dict[str, Any]:
|
|
|
547
547
|
|
|
548
548
|
|
|
549
549
|
def _backoff_delay(attempt: int) -> float:
|
|
550
|
-
"""Exponential backoff with ±25% jitter, capped at BACKOFF_MAX_S.
|
|
551
|
-
Matches plexus_ws.c:44-52."""
|
|
550
|
+
"""Exponential backoff with ±25% jitter, capped at BACKOFF_MAX_S."""
|
|
552
551
|
base = min(BACKOFF_BASE_S * (2 ** attempt), BACKOFF_MAX_S)
|
|
553
552
|
jitter = base * 0.25 * (2 * random.random() - 1)
|
|
554
553
|
return max(0.1, base + jitter)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: plexus-python
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.4
|
|
4
4
|
Summary: Thin Python SDK for Plexus — send telemetry in one line
|
|
5
5
|
Project-URL: Homepage, https://plexus.company
|
|
6
6
|
Project-URL: Documentation, https://docs.plexus.company
|
|
@@ -66,7 +66,7 @@ curl -sL https://app.plexus.company/setup | bash -s -- \
|
|
|
66
66
|
--key plx_xxx --name drone-01
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
The name must match `^[a-z0-9][a-z0-
|
|
69
|
+
The name must match `^[a-z0-9][a-z0-9._-]*$` (max 256 chars). `setup.sh` refuses to run without `--name` (or without a TTY to prompt for one) — this is deliberate, because the previous `hostname` fallback silently merged telemetry from cloned SD-card images that all booted as `raspberrypi`.
|
|
70
70
|
|
|
71
71
|
**Names are not auto-deduplicated.** The gateway echoes back whatever `source_id` you declare, unchanged — pick a unique name per device (that's what `--name` and `source_id=...` are for). Two devices that declare the same name write into the same source.
|
|
72
72
|
|
|
@@ -252,7 +252,7 @@ px.send("temperature", 72.5, timestamp=t) # your timestamp, used as-is, no cor
|
|
|
252
252
|
|
|
253
253
|
## Transport
|
|
254
254
|
|
|
255
|
-
By default the SDK connects over a **WebSocket** to `/ws/device` on the gateway —
|
|
255
|
+
By default the SDK connects over a **WebSocket** to `/ws/device` on the gateway — the gateway's device wire protocol. This gives you:
|
|
256
256
|
|
|
257
257
|
- lower-latency streaming of telemetry,
|
|
258
258
|
- live command delivery from the UI / API to the device.
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
plexus/__init__.py,sha256=
|
|
1
|
+
plexus/__init__.py,sha256=3108jW9HO6oLnblXhpp7gpqyL2ZAE7uaMC5F18gwQ5c,808
|
|
2
2
|
plexus/_log.py,sha256=3fjXrHFZghQ_17umMcvDUjjTH6aTQB3J4SpVDBiH03w,335
|
|
3
3
|
plexus/batching.py,sha256=mPMa3m9xK-DCwRmuyL_aqaTltimIOtwoDzz4PfKWyh8,10452
|
|
4
4
|
plexus/buffer.py,sha256=UNv_jEcrDwbkjJ6uhCehb7uBI2EuFEwO40waDpZn_5I,9579
|
|
5
5
|
plexus/cli.py,sha256=YFkptze8LRc6mBmDgbsTeU8J6i8MMsdTWvtm3jCINiI,21773
|
|
6
6
|
plexus/client.py,sha256=H69DR30pj3X8PiURZsViGTDHsIsQ2Kn4muHNECsioKw,53865
|
|
7
7
|
plexus/config.py,sha256=RuDh5UdVGdVQld5kQlXZO6CVXO4tS0HBalyaoAlXNvc,4416
|
|
8
|
-
plexus/ws.py,sha256=
|
|
8
|
+
plexus/ws.py,sha256=xQhJCOizX-V34tF3-r7Zpzs_wnBbNSCeEoZeFFXWH7E,19763
|
|
9
9
|
plexus/cameras/__init__.py,sha256=AVu1vE1xfYk9lz1cprHlTfi0ieHf84UhQh9Z92E05b8,490
|
|
10
10
|
plexus/cameras/thermal.py,sha256=-klCEJQG5GlLtELaowWOPYomwMsLK8O5pmmX0PqUrTA,12022
|
|
11
11
|
plexus/_skills/README.md,sha256=9TNo9mssmBiBPkrYBiA2JJHWOIAEw6DvCWCYAvfzmjM,3243
|
|
12
12
|
plexus/_skills/plexus/SKILL.md,sha256=Q1ZYe9YH-gOhMcGYuMG5H9DkHMfQOr3OazCtlxtP9f8,13617
|
|
13
13
|
plexus/_skills/plexus-dashboard/SKILL.md,sha256=8xjdvI3orM31XHTLv1fSAWstCGMwt1HnEbo0SlpTxV4,9508
|
|
14
|
-
plexus/_skills/plexus-firmware/SKILL.md,sha256=
|
|
15
|
-
plexus_python-0.11.
|
|
16
|
-
plexus_python-0.11.
|
|
17
|
-
plexus_python-0.11.
|
|
18
|
-
plexus_python-0.11.
|
|
19
|
-
plexus_python-0.11.
|
|
14
|
+
plexus/_skills/plexus-firmware/SKILL.md,sha256=C5tOGu0_LOb76n8US2SLpWSdZdeHQIa4e_5fvkX4DGU,12093
|
|
15
|
+
plexus_python-0.11.4.dist-info/METADATA,sha256=wu8laMoqY4e-3NtQbbma-LQFg4C0C6f0-1MwVzskasY,13532
|
|
16
|
+
plexus_python-0.11.4.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
17
|
+
plexus_python-0.11.4.dist-info/entry_points.txt,sha256=YlkOtTn_7Q_IGuJaKdvpU-90dCeBSPx2p_UTGMAz5Zs,43
|
|
18
|
+
plexus_python-0.11.4.dist-info/licenses/LICENSE,sha256=nm3qP1F-JAGcfLpRVtIX24L20LMnRpxmZ2oKZzFpLVo,10755
|
|
19
|
+
plexus_python-0.11.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|