tplink-smartdevices 1.0.0

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

// Install tplink-smartdevices as a Cake Tool
#tool nuget:?package=tplink-smartdevices&version=1.0.0                

.NET Standard 1.6 Library for Discovering and Operating TP-Link Smart Devices

This library allows a developer to discover and operate TP-Link Smart Devices with C# applications such as Xamarin, UWP or .net framework. This includes support for TP-Link Smart Plugs HS100/105/110 as well as TP-Link Smart Bulbs KL/LB: 100/110/120/130.

This project is migrated to .net standard from Anthony Turner's TP-Link Smart Devices SDK: <br> https://github.com/anthturner/TPLinkSmartDevices <br> some minor changes have been made, e.g added asynchronous code, support of newer KL-series bulbs

Consult https://github.com/dotnet/standard/blob/master/docs/versions.md to see which .net platform versions can implement this library before using!

Prerequisites

Before using tplink-smartdevices your devices must be connected to the Wi-Fi network. This can be done using the TP-Link provided mobile app Kasa.

Usage

Use NuGet package manager to add a reference to this project, for example with dotnet cli:

> dotnet add package tplink-smartdevices --version 1.0.0

Discovery

// Runs in a async Task<List<XamarinTPLinkSmartDevice>>
var discoveredDevices = await new TPLinkDiscovery().Discover();

Example Usage

var smartPlug = new TPLinkSmartPlug("100.10.4.1");
smartPlug.OutletPowered = true; // Turn on relay
smartPlug.OutletPowered = false; // Turn off relay

var smartBulb = new TPLinkSmartBulb("100.10.4.2");
smartBulb.PoweredOn = true; // Turn on bulb
smartBulb.PoweredOn = false; // Turn off bulb

or after discovery:

foreach (var item in discoveredDevices)
{
    if (item is TPLinkSmartPlug plug)
    {
        plug.OutletPowered = true;
    }
    else if (item is TPLinkSmartBulb bulb) 
    {
        bulb.PoweredOn = true;
    }
}

Disclaimer

I can not guarantee the functionality of this library as I only tested a HS100 and a KL130 in a Xamarin.Android application yet.

This library has no affiliation with TP-Link. TP-Link and all respective product names are copyright TP-Link Technologies Co, Ltd. and/or its subsidiaries and affiliates.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.6 is compatible.  netstandard2.0 was computed.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
2.0.1 663 7/29/2022
2.0.0 862 4/5/2021
1.0.4 482 11/16/2020
1.0.4-beta1 356 10/11/2020
1.0.3 480 8/8/2020
1.0.2 549 5/2/2020
1.0.1 445 4/8/2020
1.0.0 480 3/15/2020