- Overview
- ConnectionStatus
ConnectionStatus
Part of Diagnostics & preflight in the Python API reference.
Related guidance: getting-started/preflight, how-to/troubleshooting.
Runnable examples: preflight.py.
from picogrid_ecn_client import ConnectionStatusSummarize the client’s lifecycle and MQTT connection state.
ConnectionStatus( *, state: ClientState, ready: bool, mqtt_connected: bool, changed_at: datetime, connection_generation: int = 0, consecutive_attempt_count: int = 0, last_connected_at: datetime | None = None, last_disconnected_at: datetime | None = None, next_retry_at: datetime | None = None, last_failure_code: ConnectionFailureCode | None = None, last_failure_operation: ConnectionFailureOperation | None = None, retry_state: ConnectionRetryState = ConnectionRetryState.INACTIVE,)Source · models/diagnostics.py
Fields
Section titled “Fields”| Name | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
| state | ClientState | yes | — | — | Current client lifecycle state. |
| ready | bool | yes | — | — | Whether the client is in READY state with MQTT connected. |
| mqtt_connected | bool | yes | — | — | Whether the client currently has an MQTT v5 connection. |
| changed_at | datetime | yes | — | — | Timezone-aware UTC time when this status snapshot last changed. |
| connection_generation | int | no | 0 | ge=0 | Number of connections that reached strict readiness, starting at zero. |
| consecutive_attempt_count | int | no | 0 | ge=0 | Attempts in the current recovery episode; reset after stable readiness or a deliberate new episode. |
| last_connected_at | datetime | None | no | None | — | UTC time when the most recent MQTT v5 CONNACK succeeded. |
| last_disconnected_at | datetime | None | no | None | — | UTC time when the most recent MQTT transport connection ended. |
| next_retry_at | datetime | None | no | None | — | UTC estimate for the next scheduled retry, when one is scheduled. |
| last_failure_code | ConnectionFailureCode | None | no | None | — | Stable secret-safe classification of the latest recovery failure. |
| last_failure_operation | ConnectionFailureOperation | None | no | None | — | Stable connection phase associated with the latest recovery failure. |
| retry_state | ConnectionRetryState | no | ConnectionRetryState.INACTIVE | — | Current state of the sole reconnect supervisor. |
Version 0.2.0 · branch main
