Search Results for

    Show / Hide Table of Contents

    Class HsFeature

    • C#
    • Visual Basic
    [Obfuscation(Exclude = true, ApplyToMembers = true)]
    [Serializable]
    public class HsFeature : AbstractHsDevice
    <Obfuscation(Exclude:=True, ApplyToMembers:=True)>
    <Serializable>
    Public Class HsFeature
        Inherits AbstractHsDevice
    Inheritance
    System.Object
    AbstractHsDevice
    HsFeature
    Inherited Members
    AbstractHsDevice.Changes
    AbstractHsDevice.Ref
    AbstractHsDevice.Address
    AbstractHsDevice.AssociatedDevices
    AbstractHsDevice.Code
    AbstractHsDevice.DisplayedStatus
    AbstractHsDevice.Image
    AbstractHsDevice.Interface
    AbstractHsDevice.IsValueInvalid
    AbstractHsDevice.LastChange
    AbstractHsDevice.Location
    AbstractHsDevice.Location2
    AbstractHsDevice.Misc
    AbstractHsDevice.Name
    AbstractHsDevice.PlugExtraData
    AbstractHsDevice.Relationship
    AbstractHsDevice.Status
    AbstractHsDevice.StatusString
    AbstractHsDevice.TypeInfo
    AbstractHsDevice.UserAccess
    AbstractHsDevice.UserNote
    AbstractHsDevice.Value
    AbstractHsDevice.VoiceCommand
    AbstractHsDevice.Version
    AbstractHsDevice._address
    AbstractHsDevice._assDevices
    AbstractHsDevice._cacheChanges
    AbstractHsDevice._displayedStatus
    AbstractHsDevice._image
    AbstractHsDevice._interface
    AbstractHsDevice._invalidValue
    AbstractHsDevice._lastChange
    AbstractHsDevice._location
    AbstractHsDevice._location2
    AbstractHsDevice._misc
    AbstractHsDevice._name
    AbstractHsDevice._plugExtraData
    AbstractHsDevice._relationship
    AbstractHsDevice._status
    AbstractHsDevice._statusString
    AbstractHsDevice._typeInfo
    AbstractHsDevice._userAccess
    AbstractHsDevice._userNote
    AbstractHsDevice._value
    AbstractHsDevice._voiceCommand
    AbstractHsDevice._version
    AbstractHsDevice.RevertChanges()
    AbstractHsDevice.AddMiscFlag(EMiscFlag)
    AbstractHsDevice.ContainsMiscFlag(EMiscFlag)
    AbstractHsDevice.RemoveMiscFlag(EMiscFlag)
    AbstractHsDevice.ClearMiscFlags()
    AbstractHsDevice.GetMiscForFlags(EMiscFlag[])
    AbstractHsDevice.GetAddressFromAddressString(String)
    AbstractHsDevice.GetCodeFromAddressString(String)
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    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 Source

    HsFeature()

    Declaration
    • C#
    • Visual Basic
    HsFeature()
    Sub New
    View Source

    HsFeature(Int32)

    Create a HomeSeer feature with the specified unique ID

    Declaration
    • C#
    • Visual Basic
    public HsFeature(int featureRef)
    Public Sub New(featureRef As Integer)
    Parameters
    Type Name Description
    System.Int32 featureRef

    The unique ID associated with this feature

    Fields

    View Source

    _additionalStatusData

    Declaration
    • C#
    • Visual Basic
    List<string> _additionalStatusData
    _additionalStatusData As List(Of String)
    Field Value
    Type Description
    System.Collections.Generic.List<System.String>
    View Source

    _displayPriority

    Declaration
    • C#
    • Visual Basic
    int _displayPriority
    _displayPriority As Integer
    Field Value
    Type Description
    System.Int32
    View Source

    _displayType

    Declaration
    • C#
    • Visual Basic
    int _displayType
    _displayType As Integer
    Field Value
    Type Description
    System.Int32
    View Source

    _statusControls

    Declaration
    • C#
    • Visual Basic
    StatusControlCollection _statusControls
    _statusControls As StatusControlCollection
    Field Value
    Type Description
    StatusControlCollection
    View Source

    _statusGraphics

    Declaration
    • C#
    • Visual Basic
    StatusGraphicCollection _statusGraphics
    _statusGraphics As StatusGraphicCollection
    Field Value
    Type Description
    StatusGraphicCollection

    Properties

    View Source

    AdditionalStatusData

    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
    • C#
    • Visual Basic
    public List<string> AdditionalStatusData { get; set; }
    Public Property AdditionalStatusData As List(Of String)
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>
    View Source

    DisplayPriority

    The priority of the feature when being considered for display where 1 is the most important.

    Declaration
    • C#
    • Visual Basic
    public int DisplayPriority { get; }
    Public ReadOnly Property DisplayPriority As Integer
    Property Value
    Type Description
    System.Int32
    Remarks

    This is property is read-only. Modify FeatureDisplayPriority to change this property on HS.

    View Source

    DisplayType

    The EFeatureDisplayType for a feature.

    Declaration
    • C#
    • Visual Basic
    public EFeatureDisplayType DisplayType { get; set; }
    Public Property DisplayType As EFeatureDisplayType
    Property Value
    Type Description
    EFeatureDisplayType
    Remarks

    This is used to help HS determine how it should be displayed to the user

    View Source

    StatusControls

    A StatusControlCollection describing all of the StatusControls associated with this feature.

    Declaration
    • C#
    • Visual Basic
    public StatusControlCollection StatusControls { get; }
    Public ReadOnly Property StatusControls As StatusControlCollection
    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

    View Source

    StatusGraphics

    A StatusGraphicCollection describing all of the StatusGraphics associated with this feature.

    Declaration
    • C#
    • Visual Basic
    public StatusGraphicCollection StatusGraphics { get; }
    Public ReadOnly Property StatusGraphics As StatusGraphicCollection
    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 Source

    AddStatusControl(StatusControl)

    Declaration
    • C#
    • Visual Basic
    void AddStatusControl(StatusControl statusControl)
    Sub AddStatusControl(statusControl As StatusControl)
    Parameters
    Type Name Description
    StatusControl statusControl
    View Source

    AddStatusControls(List<StatusControl>)

    Declaration
    • C#
    • Visual Basic
    void AddStatusControls(List<StatusControl> statusControls)
    Sub AddStatusControls(statusControls As List(Of StatusControl))
    Parameters
    Type Name Description
    System.Collections.Generic.List<StatusControl> statusControls
    View Source

    AddStatusGraphic(StatusGraphic)

    Declaration
    • C#
    • Visual Basic
    void AddStatusGraphic(StatusGraphic statusGraphic)
    Sub AddStatusGraphic(statusGraphic As StatusGraphic)
    Parameters
    Type Name Description
    StatusGraphic statusGraphic
    View Source

    AddStatusGraphics(List<StatusGraphic>)

    Declaration
    • C#
    • Visual Basic
    void AddStatusGraphics(List<StatusGraphic> statusGraphics)
    Sub AddStatusGraphics(statusGraphics As List(Of StatusGraphic))
    Parameters
    Type Name Description
    System.Collections.Generic.List<StatusGraphic> statusGraphics
    View Source

    ClearStatusControls()

    Declaration
    • C#
    • Visual Basic
    void ClearStatusControls()
    Sub ClearStatusControls
    View Source

    ClearStatusGraphics()

    Declaration
    • C#
    • Visual Basic
    void ClearStatusGraphics()
    Sub ClearStatusGraphics
    View Source

    CreateControlEvent(Double)

    Create a ControlEvent for the given value based on this features defined controls

    Declaration
    • C#
    • Visual Basic
    public ControlEvent CreateControlEvent(double value)
    Public Function CreateControlEvent(value As Double) As ControlEvent
    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

    View Source

    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
    • C#
    • Visual Basic
    public HsFeature Duplicate(int featureRef)
    Public Function Duplicate(featureRef As Integer) As HsFeature
    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

    View Source

    GetAdditionalDataToken(Int32)

    Get the additional data token corresponding to the specified index $%tokenIndex$

    Declaration
    • C#
    • Visual Basic
    public static string GetAdditionalDataToken(int tokenIndex)
    Public Shared Function GetAdditionalDataToken(tokenIndex As Integer) As String
    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

    View Source

    GetControlsForUse(EControlUse)

    Get all StatusControls in the collection which have a specific EControlUse

    Declaration
    • C#
    • Visual Basic
    public List<StatusControl> GetControlsForUse(EControlUse controlUse)
    Public Function GetControlsForUse(controlUse As EControlUse) As List(Of StatusControl)
    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 controlUse.

    Remarks

    If no StatusControls are found with the specified controlUse, an empty List is returned.

    View Source

    GetFirstControlForUse(EControlUse)

    Get a StatusControl associated with the feature that has a specific EControlUse

    Declaration
    • C#
    • Visual Basic
    public StatusControl GetFirstControlForUse(EControlUse controlUse)
    Public Function GetFirstControlForUse(controlUse As EControlUse) As StatusControl
    Parameters
    Type Name Description
    EControlUse controlUse

    The EControlUse value to look for

    Returns
    Type Description
    StatusControl

    The first StatusControl found that has the specified controlUse.

    Exceptions
    Type Condition
    System.InvalidOperationException

    Thrown if no element is found with the specified controlUse

    View Source

    HasControlForRange(ValueRange)

    Determine if the feature has a StatusControl associated with the specified range of values

    Declaration
    • C#
    • Visual Basic
    public bool HasControlForRange(ValueRange range)
    Public Function HasControlForRange(range As ValueRange) As Boolean
    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.

    View Source

    HasControlForUse(EControlUse)

    Determine if the feature has a StatusControl with a specific EControlUse

    Declaration
    • C#
    • Visual Basic
    public bool HasControlForUse(EControlUse controlUse)
    Public Function HasControlForUse(controlUse As EControlUse) As Boolean
    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.

    View Source

    HasControlForValue(Double)

    Determine if the feature has a StatusControl associated with the specified value

    Declaration
    • C#
    • Visual Basic
    public bool HasControlForValue(double value)
    Public Function HasControlForValue(value As Double) As Boolean
    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.

    View Source

    HasGraphicForRange(ValueRange)

    Determine if the feature has a StatusGraphic associated with the specified range of values

    Declaration
    • C#
    • Visual Basic
    public bool HasGraphicForRange(ValueRange range)
    Public Function HasGraphicForRange(range As ValueRange) As Boolean
    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.

    View Source

    HasGraphicForValue(Double)

    Determine if the feature has a StatusGraphic associated with the specified value

    Declaration
    • C#
    • Visual Basic
    public bool HasGraphicForValue(double value)
    Public Function HasGraphicForValue(value As Double) As Boolean
    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.

    View Source

    IsValueValid()

    Determine whether the current value is valid.

    Declaration
    • C#
    • Visual Basic
    protected override bool IsValueValid()
    Protected Overrides Function IsValueValid As Boolean
    Returns
    Type Description
    System.Boolean

    Always TRUE when not overriden

    Overrides
    AbstractHsDevice.IsValueValid()
    View Source

    RemoveStatusControl(StatusControl)

    Declaration
    • C#
    • Visual Basic
    void RemoveStatusControl(StatusControl statusControl)
    Sub RemoveStatusControl(statusControl As StatusControl)
    Parameters
    Type Name Description
    StatusControl statusControl
    View Source

    RemoveStatusGraphic(StatusGraphic)

    Declaration
    • C#
    • Visual Basic
    void RemoveStatusGraphic(StatusGraphic statusGraphic)
    Sub RemoveStatusGraphic(statusGraphic As StatusGraphic)
    Parameters
    Type Name Description
    StatusGraphic statusGraphic
    View Source

    SetDisplayPriority(Int32)

    Set the DisplayPriority.

    Declaration
    • C#
    • Visual Basic
    void SetDisplayPriority(int index)
    Sub SetDisplayPriority(index As Integer)
    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 index less than 0 is specified

    View Source

    SetParentDevice(Int32)

    Declaration
    • C#
    • Visual Basic
    void SetParentDevice(int deviceRef)
    Sub SetParentDevice(deviceRef As Integer)
    Parameters
    Type Name Description
    System.Int32 deviceRef
    • View Source
    In This Article
    Back to top HomeSeer Technologies