Getting online devices

Ingestion is fast

Ingestion occurs with low latency. Querying the default health stream ($ can be used as an "online" heartbeat.

Script for determining whether a device is online

import datetime

from import Client as FormantCloudClient

def iso_seconds_ago(seconds):
    return (
        - datetime.timedelta(seconds=seconds)

if __name__ == "__main__":
    fclient = FormantCloudClient()

    deviceId = "c04ca692-57f4-438d-8946-7b1e8b17e815"
    online_threshold_seconds = 10

    results = fclient.query(
            "deviceIds": [deviceId],
            "names": ["$"],
            "start": iso_seconds_ago(online_threshold_seconds),
            "end": iso_seconds_ago(0),

    if len(results) == 0:
        print("Not online.")