klf-200-api
    Preparing search index...

    Class Products

    Use the products object to retrieve a list of products known to your KLF interface. Products are e.g. windows, roller shutters, awnings.

    To create an instance of the Products class use the static method Products.createProductsAsync.

    Products

    Implements

    • Disposable
    Index

    Properties

    Connection: IConnection

    The connection object that handles the communication to the KLF interface.

    Products: Product[] = []

    Contains a list of products. The index of each product corresponds to the system table index. The range is [0-199].

    Methods

    • Returns void

    • Find a product by its name.

      Parameters

      • productName: string

        Name of the product

      Returns undefined | Product

      Returns a [[Product]] instance if found, otherwise undefined.

    • Adds a handler that will be called if a new product is added to the KLF-200 interface.

      Parameters

      • handler: Listener<number>

        Event handler that is called if a new product is added.

      Returns Disposable

      The event handler can be removed by using the dispose method of the returned object.

    • Adds a handler that will be called if a product is removed from the KLF-200 interface.

      Parameters

      • handler: Listener<number>

        Event handler that is called if a product is removed.

      Returns Disposable

      The event handler can be removed by using the dispose method of the returned object.

    • Requests status data directly from one or more products.

      You can use this method to refresh the state of products in case that you have missed changes, e.g. a simple remote control may change the state of the product and you won't receive an event for it.

      Parameters

      • Nodes: number | number[]

        The ID of a single product node or an array of IDs of multiple product nodes for which you want to get the status.

      • StatusType: StatusType

        The type of request, e.g. current position, target position

      • OptionalFunctionalParameters: number[] = []

        Additional functional parameters (FP1-FP16) that should be requested. A maximum of 7 functional parameters can be requested with each call.

      Returns Promise<number>

      The fulfilled promise will return the SessionID.

    • Creates a new instance of the Products class. During the initialization phase of the class a list of all registered products will be retrieved from the KFL-200 interface and stored at the Product array.

      Additionally, some notification handlers will be instantiated to watch for changes to the products.

      Parameters

      • Connection: IConnection

        The connection object that handles the communication to the KLF interface.

      Returns Promise<Products>

      Resolves to a new instance of the Products class.