Search Results for

    Show / Hide Table of Contents

    Class TriggerTypeCollection

    • C#
    • Visual Basic
    public class TriggerTypeCollection : BaseTypeCollection<AbstractTriggerType>
    Public Class TriggerTypeCollection
        Inherits BaseTypeCollection(Of AbstractTriggerType)
    Inheritance
    System.Object
    BaseTypeCollection<AbstractTriggerType>
    TriggerTypeCollection
    Inherited Members
    BaseTypeCollection<AbstractTriggerType>.Count
    BaseTypeCollection<AbstractTriggerType>.ConstructorSignatures
    BaseTypeCollection<AbstractTriggerType>.MatchAllSignatures
    BaseTypeCollection<AbstractTriggerType>._itemTypes
    BaseTypeCollection<AbstractTriggerType>._itemTypeNames
    BaseTypeCollection<AbstractTriggerType>.AddItemType(Type)
    BaseTypeCollection<AbstractTriggerType>.GetObjectFromInfo(Int32)
    BaseTypeCollection<AbstractTriggerType>.GetObjectFromInfo(Int32, Int32, Object[])
    BaseTypeCollection<AbstractTriggerType>.TypeHasConstructor(Int32, Int32)
    BaseTypeCollection<AbstractTriggerType>.AssertTypeHasConstructors(Type)
    BaseTypeCollection<AbstractTriggerType>.AssertTypeHasEmptyConstructor(Type)
    BaseTypeCollection<AbstractTriggerType>.AssertTypeHasConstructor(Type, Type[])
    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.Events
    Assembly: PluginSdk.dll


    A collection of AbstractTriggerTypes that can be used by users to create HomeSeer Event Triggers.

    An instance of this class is a field on AbstractPlugin initialized in the constructor. In addition, all calls from HomeSeer related to triggers are automatically routed through that instance.


    Remarks

    Add trigger types supported by your plugin using AddTriggerType(Type)

    Due to the fact that HomeSeer saves the index of the trigger type in its internal database, avoid changing the index of any of the types available to the user. Doing so may result in an incorrect AbstractTriggerType being instantiated and producing errors because the configuration parameters and signature of the trigger type do not match.

    Constructors

    View Source

    TriggerTypeCollection(TriggerTypeCollection.ITriggerTypeListener)

    Initialize a new instance of an TriggerTypeCollection with the specified listener

    Declaration
    • C#
    • Visual Basic
    public TriggerTypeCollection(TriggerTypeCollection.ITriggerTypeListener listener)
    Public Sub New(listener As TriggerTypeCollection.ITriggerTypeListener)
    Parameters
    Type Name Description
    TriggerTypeCollection.ITriggerTypeListener listener

    An TriggerTypeCollection.ITriggerTypeListener that will be passed to trigger types

    Fields

    View Source

    _listener

    Declaration
    • C#
    • Visual Basic
    TriggerTypeCollection.ITriggerTypeListener _listener
    _listener As TriggerTypeCollection.ITriggerTypeListener
    Field Value
    Type Description
    TriggerTypeCollection.ITriggerTypeListener

    Properties

    View Source

    LogDebug

    Used to enable/disable internal logging to the console

    When it is TRUE, log messages from the PluginSdk code will be written to the Console

    Declaration
    • C#
    • Visual Basic
    public bool LogDebug { get; set; }
    Public Property LogDebug As Boolean
    Property Value
    Type Description
    System.Boolean
    View Source

    TriggerTypes

    System.Collections.Generic.List<T> of System.Type that are a subclass of AbstractTriggerType

    Declaration
    • C#
    • Visual Basic
    public List<Type> TriggerTypes { get; }
    Public ReadOnly Property TriggerTypes As List(Of Type)
    Property Value
    Type Description
    System.Collections.Generic.List<System.Type>
    Remarks

    These represent the types of AbstractTriggerType that are available for users

    Methods

    View Source

    AddTriggerType(Type)

    Add the specified class type that derives from AbstractTriggerType to the list of triggers

    Declaration
    • C#
    • Visual Basic
    public void AddTriggerType(Type triggerType)
    Public Sub AddTriggerType(triggerType As Type)
    Parameters
    Type Name Description
    System.Type triggerType

    The System.Type of the class that derives from AbstractTriggerType

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when the specified class type will not work as a trigger

    View Source

    GetName(Int32)

    Get the name of the trigger type at the specified index

    Declaration
    • C#
    • Visual Basic
    public string GetName(int triggerIndex)
    Public Function GetName(triggerIndex As Integer) As String
    Parameters
    Type Name Description
    System.Int32 triggerIndex

    The 1 based index of the trigger type to get the name for

    Returns
    Type Description
    System.String

    The name of the trigger type

    View Source

    GetObjectFromTrigInfo(TrigActInfo)

    Get an instance of an AbstractTriggerType from a TrigActInfo.

    Declaration
    • C#
    • Visual Basic
    public AbstractTriggerType GetObjectFromTrigInfo(TrigActInfo trigInfo)
    Public Function GetObjectFromTrigInfo(trigInfo As TrigActInfo) As AbstractTriggerType
    Parameters
    Type Name Description
    TrigActInfo trigInfo

    An instance of TrigActInfo that represents a trigger.

    Returns
    Type Description
    AbstractTriggerType

    An instance of an AbstractTriggerType. This will be one of the types in the TriggerTypes list.

    Remarks

    TANumber is used to identify which of the AbstractTriggerTypes is used.

    Exceptions
    Type Condition
    System.TypeLoadException

    Thrown if the AbstractTriggerType that is referenced by TANumber does not have the proper constructor.

    • AbstractTriggerType(Int32, Int32, Int32, Byte[], TriggerTypeCollection.ITriggerTypeListener)
    • AbstractTriggerType(Int32, Int32, Int32, Byte[], TriggerTypeCollection.ITriggerTypeListener, Boolean)
    View Source

    GetSubTriggerCount(Int32)

    Called by HomeSeer to determine the number of available sub-trigger types available under the trigger type at the specified index.

    Declaration
    • C#
    • Visual Basic
    public int GetSubTriggerCount(int triggerIndex)
    Public Function GetSubTriggerCount(triggerIndex As Integer) As Integer
    Parameters
    Type Name Description
    System.Int32 triggerIndex

    The 1 based index of the trigger type to get the sub-trigger count for

    Returns
    Type Description
    System.Int32

    The number of sub-trigger types available under the trigger type specified

    View Source

    GetSubTriggerName(Int32, Int32)

    Get the name of the sub-trigger type at the specified index

    Declaration
    • C#
    • Visual Basic
    public string GetSubTriggerName(int triggerIndex, int subTriggerIndex)
    Public Function GetSubTriggerName(triggerIndex As Integer, subTriggerIndex As Integer) As String
    Parameters
    Type Name Description
    System.Int32 triggerIndex

    The 1 based index of the trigger type the sub-trigger is a member of

    System.Int32 subTriggerIndex

    The 1 based index of the sub-trigger type to get the name for

    Returns
    Type Description
    System.String

    The name of the sub-trigger type

    View Source

    IsTriggerConfigured(TrigActInfo)

    Called by HomeSeer when it needs to determine if a specific trigger is completely configured or requires additional configuration before it can be used.

    Declaration
    • C#
    • Visual Basic
    public bool IsTriggerConfigured(TrigActInfo trigInfo)
    Public Function IsTriggerConfigured(trigInfo As TrigActInfo) As Boolean
    Parameters
    Type Name Description
    TrigActInfo trigInfo

    The trigger to check

    Returns
    Type Description
    System.Boolean

    TRUE if the trigger is completely configured, FALSE if it is not. A call to OnGetTriggerUi(TrigActInfo) will be called following this if FALSE is returned.

    View Source

    IsTriggerTrue(TrigActInfo, Boolean)

    Called by HomeSeer to determine if a trigger's conditions have been met.

    Declaration
    • C#
    • Visual Basic
    public bool IsTriggerTrue(TrigActInfo trigInfo, bool isCondition)
    Public Function IsTriggerTrue(trigInfo As TrigActInfo, isCondition As Boolean) As Boolean
    Parameters
    Type Name Description
    TrigActInfo trigInfo

    The trigger to check

    System.Boolean isCondition

    TRUE if the trigger is paired with other triggers, FALSE if it is alone.

    Returns
    Type Description
    System.Boolean

    TRUE if the trigger's conditions have been met, FALSE if they haven't

    View Source

    OnGetTriggerPrettyString(TrigActInfo)

    Called by HomeSeer when it needs to get an easy to read, formatted string that communicates what the trigger does to the user.

    Declaration
    • C#
    • Visual Basic
    public string OnGetTriggerPrettyString(TrigActInfo trigInfo)
    Public Function OnGetTriggerPrettyString(trigInfo As TrigActInfo) As String
    Parameters
    Type Name Description
    TrigActInfo trigInfo

    The trigger that a pretty string is needed for

    Returns
    Type Description
    System.String

    HTML formatted text communicating what the trigger does

    View Source

    OnGetTriggerUi(TrigActInfo)

    Called by HomeSeer when it needs to display the configuration UI for a trigger type

    Declaration
    • C#
    • Visual Basic
    public string OnGetTriggerUi(TrigActInfo trigInfo)
    Public Function OnGetTriggerUi(trigInfo As TrigActInfo) As String
    Parameters
    Type Name Description
    TrigActInfo trigInfo

    The trigger to display as defined by TrigActInfo

    Returns
    Type Description
    System.String

    HTML to display on the event page for the specified trigger

    View Source

    OnUpdateTriggerConfig(Dictionary<String, String>, TrigActInfo)

    Called by HomeSeer when a user updates the configuration of a trigger and those changes are in need of processing.

    Declaration
    • C#
    • Visual Basic
    public EventUpdateReturnData OnUpdateTriggerConfig(Dictionary<string, string> postData, TrigActInfo trigInfo)
    Public Function OnUpdateTriggerConfig(postData As Dictionary(Of String, String), trigInfo As TrigActInfo) As EventUpdateReturnData
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> postData

    A System.Collections.Generic.Dictionary<TKey, TValue> of changes to the trigger configuration

    TrigActInfo trigInfo

    The trigger being configured

    Returns
    Type Description
    EventUpdateReturnData

    An EventUpdateReturnData describing the new state of the trigger that will be saved by HomeSeer. The trigger configuration will be saved if the result returned is an empty string.

    View Source

    TriggerCanBeCondition(Int32)

    Called by HomeSeer to determine if a particular trigger can be used as a condition or not. A condition is a trigger that operates in conjunction with another trigger in an AND/OR pattern.

    Declaration
    • C#
    • Visual Basic
    public bool TriggerCanBeCondition(int triggerIndex)
    Public Function TriggerCanBeCondition(triggerIndex As Integer) As Boolean
    Parameters
    Type Name Description
    System.Int32 triggerIndex

    The 1 based index of the trigger type to check

    Returns
    Type Description
    System.Boolean

    TRUE if the trigger can be used as a condition, FALSE if it can not.

    View Source

    TriggerReferencesDeviceOrFeature(Int32, TrigActInfo)

    Called by HomeSeer when it needs to determine if a specific device/feature is referenced by a particular trigger.

    Declaration
    • C#
    • Visual Basic
    public bool TriggerReferencesDeviceOrFeature(int devOrFeatRef, TrigActInfo trigInfo)
    Public Function TriggerReferencesDeviceOrFeature(devOrFeatRef As Integer, trigInfo As TrigActInfo) As Boolean
    Parameters
    Type Name Description
    System.Int32 devOrFeatRef

    The unique Ref of the device/feature

    TrigActInfo trigInfo

    The trigger to check

    Returns
    Type Description
    System.Boolean

    TRUE if the trigger references the specified device/feature, FALSE if it does not.

    • View Source
    In This Article
    Back to top HomeSeer Technologies