Table of Contents

Interface IAirthingsClient

Namespace
Tudormobile.Airthings
Assembly
Tudormobile.Airthings.dll

Provides methods for interacting with the Airthings API to manage accounts, devices, and sensor data.

public interface IAirthingsClient : IDisposable
Inherited Members

Methods

ListAccounts(CancellationToken)

Lists all accounts accessible with the current credentials.

Task<AccountsResponse> ListAccounts(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<AccountsResponse>

A task representing the asynchronous operation. The task result contains the accounts response with a list of accounts.

ListDevices(string, CancellationToken)

Lists all devices associated with the specified account.

Task<DevicesResponse> ListDevices(string accountId, CancellationToken cancellationToken = default)

Parameters

accountId string

The unique identifier of the account.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<DevicesResponse>

A task representing the asynchronous operation. The task result contains the devices response with a list of devices.

ReadSensors(string, IEnumerable<string>, UnitsType, CancellationToken)

Reads sensor data from the specified devices.

Task<DevicesSamplesResponse> ReadSensors(string accountId, IEnumerable<string> serialNumbers, UnitsType unitsType = UnitsType.Metric, CancellationToken cancellationToken = default)

Parameters

accountId string

The unique identifier of the account.

serialNumbers IEnumerable<string>

The serial numbers of the devices to read sensor data from.

unitsType UnitsType

The units type for the sensor data (e.g., Metric or Imperial).

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<DevicesSamplesResponse>

A task representing the asynchronous operation. The task result contains the sensors response with sensor data.