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
cancellationTokenCancellationTokenToken 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
accountIdstringThe unique identifier of the account.
cancellationTokenCancellationTokenToken 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
accountIdstringThe unique identifier of the account.
serialNumbersIEnumerable<string>The serial numbers of the devices to read sensor data from.
unitsTypeUnitsTypeThe units type for the sensor data (e.g., Metric or Imperial).
cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Task<DevicesSamplesResponse>
A task representing the asynchronous operation. The task result contains the sensors response with sensor data.