TPLinkSmartMultiPlug Class
Namespace: TPLinkSmartDevices.Devices
Inheritance: TPLinkSmartDevice -> TPLinkSmartMultiPlug
encloses plug specific system information and controls for plugs with multiple outlets
Properties
AllOutletsPowered
- Returns whether all the plugs outlet relais are powered on
public bool AllOutletsPowered { get; private set; }
Features
- Returns the feature (capability) abbreviations for this plug
public string[] Features { get; private set; }
LedOn
- If status led on smart plug is on
public bool LedOn { get; private set; }
OutletCount
- Returns number of outlets on this plug
public int OutletCount { get; private set; }
Outlets
- Returns array of Outlets, containing id's, names and power states of each outlet
public Outlet[] Outlets { get; private set; }
Constructors
TPLinkSmartMultiPlug(string, int)
-
Creates a new object of this type, used for HS300/HS107 plug
public TPLinkSmartPlug(string hostname, int port=9999)
- Parameters
-
string hostname
: ip-address of of this plugint port
: plug communicates on this port, defaults to9999
Methods
Refresh()
- Refreshes all properties of this plug (includes a call to
TPLinkSmartDevice.Refresh(dynamic)
for the common device information)public async Task Refresh()
SetOutletPowered(bool, int)
-
Change the plugs outlet relay state
public void SetOutletPowered(bool value, int outledId = -1)
- Parameters
-
bool value
:true
power on,false
power offint outledId
: id of outlet to turn on/off (zero-based index of all outlets)
- Exceptions
-
ArgumentException
: plug does not have a outlet with specifiedoutledId
SetLedOn(bool)
-
Change the plugs LED state; branded as night mode by tp-link :)
public void SetLedOn(bool value)
- Parameters
-
bool value
:true
LED on (day mode),false
LED off (night mode)