Skip to content

timheuer/tempstick-sharp

Repository files navigation

Build GitHub last commit Nuget

Logo

TempStick#

A simple C# client for the TempStick USB temperature sensor API.

Installation

The TempStick# library is available as a NuGet package. To install TempStickSharp, run the following command in the Package Manager Console

PM> Install-Package TempStickSharp

Usage

The TempStick# library is a simple wrapper around the TempStick API. It provides a simple interface to get the sensor information and the readings from the sensors.

Retrieve a list of sensors

var client = new TempStickClient("YOUR_API_KEY");
var sensors = await client.GetSensorsAsync();

foreach (var sensor in sensors.Data.Sensors)
{
	Console.WriteLine(sensor.SensorName);
}

Retrieve the readings for a sensor

var client = new TempStickClient("YOUR_API_KEY");
var readings = await client.GetReadingsAsync("SENSOR_ID");

foreach (var reading in readings.Data.Readings)
{
	Console.WriteLine(reading.Humidity);
	Console.WriteLine(reading.Temperature);
}

Retrieve readings for a period of time

var client = new TempStickClient("YOUR_API_KEY");
var readings = await client.GetReadingsAsync("SENSOR_ID", 32400, "30_days", null, null);

foreach (var reading in readings.Data.Readings)
{
	Console.WriteLine(reading.Humidity);
	Console.WriteLine(reading.Temperature);
}

Support

For any support, please log a bug

License

TempStick# is licensed under the MIT License

Icon

Thermometer by Anggara Putra from Noun Project (CC BY 3.0)

About

A C# client for accessing the Temp Stick API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages