PigTracks.Sensors 12.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package PigTracks.Sensors --version 12.0.1
NuGet\Install-Package PigTracks.Sensors -Version 12.0.1
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="12.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PigTracks.Sensors --version 12.0.1
#r "nuget: PigTracks.Sensors, 12.0.1"
#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=12.0.1

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

PigTracks Sensors .NET Client

Usage

Register the PigTracks Sensor Client with your services:

services.AddPigTracksSensors(new PigTracksSensorsConfiguration
{
    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/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 708 1/18/2024
15.1.0 319 1/12/2024
15.0.0 371 1/8/2024
14.0.0 349 1/4/2024
12.0.1 406 12/11/2023
12.0.0 360 12/11/2023
11.0.0 404 12/8/2023
10.0.0 349 12/8/2023
9.0.0 372 12/7/2023
8.0.0 486 11/20/2023
7.0.0 948 11/14/2023
6.2.1 367 11/13/2023
6.2.0 396 11/10/2023
6.1.2 344 11/10/2023
6.1.1 356 11/10/2023
6.1.0 341 11/10/2023
6.0.0 346 11/10/2023