Class HsDevice
[Obfuscation(Exclude = true, ApplyToMembers = true)]
[Serializable]
public class HsDevice : AbstractHsDevice
Inherited Members
Namespace: HomeSeer.PluginSdk.Devices
Assembly: PluginSdk.dll
A device connected to a HomeSeer system. This is the top level item displayed to users when they are looking at the devices connected to their system.
Constructors
View SourceHsDevice()
Declaration
HsDevice()
HsDevice(Int32)
Create a HomeSeer device with the specified unique ID
Declaration
public HsDevice(int deviceRef)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | deviceRef | The unique ID associated with this device |
Fields
View Source_featureDisplayPriority
Declaration
List<int> _featureDisplayPriority
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Int32> |
Properties
View SourceFeatureDisplayPriority
A list of Refs indicating the order of importance for the features of a device where 1 is the most important. This helps HomeSeer determine how to display features in the UI.
You must call GetDeviceWithFeaturesByRef(Int32) to fill this property, otherwise this will be an empty list.
Declaration
public List<int> FeatureDisplayPriority { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Int32> |
Remarks
This should typically be left to the user to configure, but it is recommended that you pre-configure it for users with the best setup possible by adding the HsFeatures in the desired order when using DeviceFactory to create a HsDevice.
See EFeatureDisplayType for additional info on controlling the way features are displayed.
Features
A list of HsFeatures that make up the device.
Declaration
public List<HsFeature> Features { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<HsFeature> |
Methods
View SourceDuplicate(Int32)
Make a copy of the device with a different unique ID.
This will not duplicate features associated with the device.
Declaration
public HsDevice Duplicate(int deviceRef)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | deviceRef | The new unique ID for the copy |
Returns
Type | Description |
---|---|
HsDevice | A copy of the device with a new reference ID |
GetFeatureByType(TypeInfo)
Get the first feature of the specified type associated with this device.
Declaration
public HsFeature GetFeatureByType(TypeInfo featureType)
Parameters
Type | Name | Description |
---|---|---|
TypeInfo | featureType | The TypeInfo describing the desired feature |
Returns
Type | Description |
---|---|
HsFeature | The feature associated with the device that matches that specified featureType |
Exceptions
Type | Condition |
---|---|
System.Collections.Generic.KeyNotFoundException | Thrown if there are no features or if a feature with the specified featureType was not found. |
GetFeaturesInDisplayOrder()
Get a collection of HsFeatures in the same order defined by FeatureDisplayPriority
Declaration
public List<HsFeature> GetFeaturesInDisplayOrder()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<HsFeature> | A List of HsFeatures ordered by DisplayPriority |