Class HsFeature
[Obfuscation(Exclude = true, ApplyToMembers = true)]
[Serializable]
public class HsFeature : AbstractHsDevice
Inherited Members
Namespace: HomeSeer.PluginSdk.Devices
Assembly: PluginSdk.dll
A feature of a device connected to a HomeSeer system. It encapsulates a specific component of functionality available to the device it is associated with.
For example: A battery powered device should have a feature associated with it that handles only battery related information and controls. This feature should not contain anything having to do with any other component of that device.
Constructors
View SourceHsFeature()
Declaration
HsFeature()
HsFeature(Int32)
Create a HomeSeer feature with the specified unique ID
Declaration
public HsFeature(int featureRef)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | featureRef | The unique ID associated with this feature |
Fields
View Source_additionalStatusData
Declaration
List<string> _additionalStatusData
Field Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> |
_displayPriority
Declaration
int _displayPriority
Field Value
| Type | Description |
|---|---|
| System.Int32 |
_displayType
Declaration
int _displayType
Field Value
| Type | Description |
|---|---|
| System.Int32 |
_statusControls
Declaration
StatusControlCollection _statusControls
Field Value
| Type | Description |
|---|---|
| StatusControlCollection |
_statusGraphics
Declaration
StatusGraphicCollection _statusGraphics
Field Value
| Type | Description |
|---|---|
| StatusGraphicCollection |
Properties
View SourceAdditionalStatusData
A list of strings used in the displayed status for the HsFeature. The strings in this list are used to replace the replacement tokens corresponding to each index in the status - @%INDEX@
Declaration
public List<string> AdditionalStatusData { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> |
DisplayPriority
The priority of the feature when being considered for display where 1 is the most important.
Declaration
public int DisplayPriority { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Remarks
This is property is read-only. Modify FeatureDisplayPriority to change this property on HS.
DisplayType
The EFeatureDisplayType for a feature.
Declaration
public EFeatureDisplayType DisplayType { get; set; }
Property Value
| Type | Description |
|---|---|
| EFeatureDisplayType |
Remarks
This is used to help HS determine how it should be displayed to the user
StatusControls
A StatusControlCollection describing all of the StatusControls associated with this feature.
Declaration
public StatusControlCollection StatusControls { get; }
Property Value
| Type | Description |
|---|---|
| StatusControlCollection |
Remarks
This is read only because HomeSeer needs to index StatusControls for events and other automated behaviors. To edit these use methods in IHsController
StatusGraphics
A StatusGraphicCollection describing all of the StatusGraphics associated with this feature.
Declaration
public StatusGraphicCollection StatusGraphics { get; }
Property Value
| Type | Description |
|---|---|
| StatusGraphicCollection |
Remarks
This is read only because HomeSeer needs to index StatusGraphics for events and other automated behaviors. To edit these use methods in IHsController
Methods
View SourceAddStatusControl(StatusControl)
Declaration
void AddStatusControl(StatusControl statusControl)
Parameters
| Type | Name | Description |
|---|---|---|
| StatusControl | statusControl |
AddStatusControls(List<StatusControl>)
Declaration
void AddStatusControls(List<StatusControl> statusControls)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.List<StatusControl> | statusControls |
AddStatusGraphic(StatusGraphic)
Declaration
void AddStatusGraphic(StatusGraphic statusGraphic)
Parameters
| Type | Name | Description |
|---|---|---|
| StatusGraphic | statusGraphic |
AddStatusGraphics(List<StatusGraphic>)
Declaration
void AddStatusGraphics(List<StatusGraphic> statusGraphics)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.List<StatusGraphic> | statusGraphics |
ClearStatusControls()
Declaration
void ClearStatusControls()
ClearStatusGraphics()
Declaration
void ClearStatusGraphics()
CreateControlEvent(Double)
Create a ControlEvent for the given value based on this features defined controls
Declaration
public ControlEvent CreateControlEvent(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | value | The value to set the feature to |
Returns
| Type | Description |
|---|---|
| ControlEvent | A ControlEvent with info from associated StatusControl and StatusGraphic |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | Thrown when there is no StatusControl associated with the specified value |
Duplicate(Int32)
Make a copy of the feature with a different unique ID.
This will not duplicate StatusControls or StatusGraphics associated with the device.
Declaration
public HsFeature Duplicate(int featureRef)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | featureRef | The new unique ID for the copy |
Returns
| Type | Description |
|---|---|
| HsFeature | A copy of the feature with a new reference ID |
GetAdditionalDataToken(Int32)
Get the additional data token corresponding to the specified index $%tokenIndex$
Declaration
public static string GetAdditionalDataToken(int tokenIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | tokenIndex | The index for the token |
Returns
| Type | Description |
|---|---|
| System.String | An additional data token used in the status eg for a tokenIndex of 0 returns $%0$ |
Remarks
This is used as a replacement token for the status of a feature. Tokens are replaced with data from AdditionalStatusData
GetControlsForUse(EControlUse)
Get all StatusControls in the collection which have a specific EControlUse
Declaration
public List<StatusControl> GetControlsForUse(EControlUse controlUse)
Parameters
| Type | Name | Description |
|---|---|---|
| EControlUse | controlUse | The EControlUse value to look for |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<StatusControl> | A List of StatusControls found that have the specified |
Remarks
If no StatusControls are found with the specified controlUse,
an empty List is returned.
GetFirstControlForUse(EControlUse)
Get a StatusControl associated with the feature that has a specific EControlUse
Declaration
public StatusControl GetFirstControlForUse(EControlUse controlUse)
Parameters
| Type | Name | Description |
|---|---|---|
| EControlUse | controlUse | The EControlUse value to look for |
Returns
| Type | Description |
|---|---|
| StatusControl | The first StatusControl found that has the specified |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | Thrown if no element is found with the specified |
HasControlForRange(ValueRange)
Determine if the feature has a StatusControl associated with the specified range of values
Declaration
public bool HasControlForRange(ValueRange range)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueRange | range | The range of values to look for |
Returns
| Type | Description |
|---|---|
| System.Boolean | TRUE if the feature has at least one StatusControl that targets any of the values in the range, FALSE if it does not. |
HasControlForUse(EControlUse)
Determine if the feature has a StatusControl with a specific EControlUse
Declaration
public bool HasControlForUse(EControlUse controlUse)
Parameters
| Type | Name | Description |
|---|---|---|
| EControlUse | controlUse | The EControlUse value to look for |
Returns
| Type | Description |
|---|---|
| System.Boolean | TRUE if the feature has a StatusControl with this specific EControlUse, FALSE if it does not. |
HasControlForValue(Double)
Determine if the feature has a StatusControl associated with the specified value
Declaration
public bool HasControlForValue(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | value | The value to look for |
Returns
| Type | Description |
|---|---|
| System.Boolean | TRUE if the feature has a StatusControl that targets the specified value, FALSE if it does not. |
HasGraphicForRange(ValueRange)
Determine if the feature has a StatusGraphic associated with the specified range of values
Declaration
public bool HasGraphicForRange(ValueRange range)
Parameters
| Type | Name | Description |
|---|---|---|
| ValueRange | range | The range of values to look for |
Returns
| Type | Description |
|---|---|
| System.Boolean | TRUE if the feature has at least one StatusGraphic that targets any of the values in the range, FALSE if it does not. |
HasGraphicForValue(Double)
Determine if the feature has a StatusGraphic associated with the specified value
Declaration
public bool HasGraphicForValue(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | value | The value to look for |
Returns
| Type | Description |
|---|---|
| System.Boolean | TRUE if the feature has a StatusGraphic that targets the specified value, FALSE if it does not. |
IsValueValid()
Determine whether the current value is valid.
Declaration
protected override bool IsValueValid()
Returns
| Type | Description |
|---|---|
| System.Boolean | Always TRUE when not overriden |
Overrides
View SourceRemoveStatusControl(StatusControl)
Declaration
void RemoveStatusControl(StatusControl statusControl)
Parameters
| Type | Name | Description |
|---|---|---|
| StatusControl | statusControl |
RemoveStatusGraphic(StatusGraphic)
Declaration
void RemoveStatusGraphic(StatusGraphic statusGraphic)
Parameters
| Type | Name | Description |
|---|---|---|
| StatusGraphic | statusGraphic |
SetDisplayPriority(Int32)
Set the DisplayPriority.
Declaration
void SetDisplayPriority(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The index of the HsFeature |
Remarks
This is used by the HS platform to load the value of DisplayPriority saved to the database into the HsFeature. It cannot be used to change the value of DisplayPriority saved to the HS platform database.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | Thrown when an |
SetParentDevice(Int32)
Declaration
void SetParentDevice(int deviceRef)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | deviceRef |