PigTracks.Sensors 15.2.0

dotnet add package PigTracks.Sensors --version 15.2.0
NuGet\Install-Package PigTracks.Sensors -Version 15.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PigTracks.Sensors" Version="15.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PigTracks.Sensors --version 15.2.0
#r "nuget: PigTracks.Sensors, 15.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PigTracks.Sensors as a Cake Addin
#addin nuget:?package=PigTracks.Sensors&version=15.2.0

// Install PigTracks.Sensors as a Cake Tool
#tool nuget:?package=PigTracks.Sensors&version=15.2.0

PigTracks Sensors .NET Client

Usage

Register the PigTracks Sensor Client with your services:

services.AddSensorsClient(new SensorsClientConfiguration
{
    PigTracksSensorsGraphQlEndpoint = "https://sensors-api.pigtracks.com/graphql"
});

Inject in the ISensorClient:

private readonly ISensorsClient _sensorsClient;

public MyClass(ISensorsClient sensorsClient)
{
    _sensorsClient = sensorsClient;
}

Make a call to PigTracks Sensors:

await _sensorsClient.UpdateDevice(new UpdateDeviceInput
{
    VendorId = vendorId,
    DeviceId = deviceId,
    LastUpdated = mostRecentHeartbeat.HeartbeatTimeStamp.AsUtc(),
    LastLatitude = mostRecentHeartbeat.Lat.ToDecimalWhereZeroIsNull(),
    LastLongitude = mostRecentHeartbeat.Lon.ToDecimalWhereZeroIsNull(),
    LastBatteryStrength = mostRecentHeartbeat.Battery,
    LastSatelliteSignalStrength = mostRecentHeartbeat.IsIridium.HasValue && mostRecentHeartbeat.IsIridium.Value ? mostRecentHeartbeat.SignalStrength : null,
    LastCellSignalStrength = !mostRecentHeartbeat.IsIridium.HasValue || !mostRecentHeartbeat.IsIridium.Value ? mostRecentHeartbeat.SignalStrength : null,
    Temperature = mostRecentHeartbeat.Temperature,
    IsGeophoneConnected = mostRecentHeartbeat.GeophoneConnected,
});

Updating the GraphQL Schema

cd PigTracks.Sensors.Client/SensorsApi
dotnet graphql update
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
15.2.0 589 1/18/2024
15.1.0 317 1/12/2024
15.0.0 369 1/8/2024
14.0.0 347 1/4/2024
12.0.1 404 12/11/2023
12.0.0 358 12/11/2023
11.0.0 402 12/8/2023
10.0.0 347 12/8/2023
9.0.0 370 12/7/2023
8.0.0 484 11/20/2023
7.0.0 946 11/14/2023
6.2.1 365 11/13/2023
6.2.0 394 11/10/2023
6.1.2 342 11/10/2023
6.1.1 354 11/10/2023
6.1.0 339 11/10/2023
6.0.0 344 11/10/2023