Interface IConnection

Interface for the connection.

IConnection

interface IConnection {
    KLF200SocketProtocol?: KLF200SocketProtocol;
    loginAsync(password: string, timeout?: number): Promise<void>;
    logoutAsync(timeout?: number): Promise<void>;
    on(handler: Listener<IGW_FRAME_RCV>, filter?: GatewayCommand[]): Disposable;
    onFrameSent(handler: Listener<IGW_FRAME_REQ>, filter?: GatewayCommand[]): Disposable;
    sendFrameAsync(frame: GW_REBOOT_REQ, timeout?: number): Promise<GW_REBOOT_CFM>;
    sendFrameAsync(frame: GW_SET_FACTORY_DEFAULT_REQ, timeout?: number): Promise<GW_SET_FACTORY_DEFAULT_CFM>;
    sendFrameAsync(frame: GW_GET_VERSION_REQ, timeout?: number): Promise<GW_GET_VERSION_CFM>;
    sendFrameAsync(frame: GW_GET_PROTOCOL_VERSION_REQ, timeout?: number): Promise<GW_GET_PROTOCOL_VERSION_CFM>;
    sendFrameAsync(frame: GW_GET_STATE_REQ, timeout?: number): Promise<GW_GET_STATE_CFM>;
    sendFrameAsync(frame: GW_LEAVE_LEARN_STATE_REQ, timeout?: number): Promise<GW_LEAVE_LEARN_STATE_CFM>;
    sendFrameAsync(frame: GW_GET_NETWORK_SETUP_REQ, timeout?: number): Promise<GW_GET_NETWORK_SETUP_CFM>;
    sendFrameAsync(frame: GW_SET_NETWORK_SETUP_REQ, timeout?: number): Promise<GW_SET_NETWORK_SETUP_CFM>;
    sendFrameAsync(frame: GW_CS_GET_SYSTEMTABLE_DATA_REQ, timeout?: number): Promise<GW_CS_GET_SYSTEMTABLE_DATA_CFM>;
    sendFrameAsync(frame: GW_CS_DISCOVER_NODES_REQ, timeout?: number): Promise<GW_CS_DISCOVER_NODES_CFM>;
    sendFrameAsync(frame: GW_CS_REMOVE_NODES_REQ, timeout?: number): Promise<GW_CS_REMOVE_NODES_CFM>;
    sendFrameAsync(frame: GW_CS_VIRGIN_STATE_REQ, timeout?: number): Promise<GW_CS_VIRGIN_STATE_CFM>;
    sendFrameAsync(frame: GW_CS_CONTROLLER_COPY_REQ, timeout?: number): Promise<GW_CS_CONTROLLER_COPY_CFM>;
    sendFrameAsync(frame: GW_CS_RECEIVE_KEY_REQ, timeout?: number): Promise<GW_CS_RECEIVE_KEY_CFM>;
    sendFrameAsync(frame: GW_CS_GENERATE_NEW_KEY_REQ, timeout?: number): Promise<GW_CS_GENERATE_NEW_KEY_CFM>;
    sendFrameAsync(frame: GW_CS_REPAIR_KEY_REQ, timeout?: number): Promise<GW_CS_REPAIR_KEY_CFM>;
    sendFrameAsync(frame: GW_CS_ACTIVATE_CONFIGURATION_MODE_REQ, timeout?: number): Promise<GW_CS_ACTIVATE_CONFIGURATION_MODE_CFM>;
    sendFrameAsync(frame: GW_GET_NODE_INFORMATION_REQ, timeout?: number): Promise<GW_GET_NODE_INFORMATION_CFM>;
    sendFrameAsync(frame: GW_GET_ALL_NODES_INFORMATION_REQ, timeout?: number): Promise<GW_GET_ALL_NODES_INFORMATION_CFM>;
    sendFrameAsync(frame: GW_SET_NODE_VARIATION_REQ, timeout?: number): Promise<GW_SET_NODE_VARIATION_CFM>;
    sendFrameAsync(frame: GW_SET_NODE_NAME_REQ, timeout?: number): Promise<GW_SET_NODE_NAME_CFM>;
    sendFrameAsync(frame: GW_SET_NODE_ORDER_AND_PLACEMENT_REQ, timeout?: number): Promise<GW_SET_NODE_ORDER_AND_PLACEMENT_CFM>;
    sendFrameAsync(frame: GW_GET_GROUP_INFORMATION_REQ, timeout?: number): Promise<GW_GET_GROUP_INFORMATION_CFM>;
    sendFrameAsync(frame: GW_SET_GROUP_INFORMATION_REQ, timeout?: number): Promise<GW_SET_GROUP_INFORMATION_CFM>;
    sendFrameAsync(frame: GW_DELETE_GROUP_REQ, timeout?: number): Promise<GW_DELETE_GROUP_CFM>;
    sendFrameAsync(frame: GW_NEW_GROUP_REQ, timeout?: number): Promise<GW_NEW_GROUP_CFM>;
    sendFrameAsync(frame: GW_GET_ALL_GROUPS_INFORMATION_REQ, timeout?: number): Promise<GW_GET_ALL_GROUPS_INFORMATION_CFM>;
    sendFrameAsync(frame: GW_HOUSE_STATUS_MONITOR_ENABLE_REQ, timeout?: number): Promise<GW_HOUSE_STATUS_MONITOR_ENABLE_CFM>;
    sendFrameAsync(frame: GW_HOUSE_STATUS_MONITOR_DISABLE_REQ, timeout?: number): Promise<GW_HOUSE_STATUS_MONITOR_DISABLE_CFM>;
    sendFrameAsync(frame: GW_COMMAND_SEND_REQ, timeout?: number): Promise<GW_COMMAND_SEND_CFM>;
    sendFrameAsync(frame: GW_STATUS_REQUEST_REQ, timeout?: number): Promise<GW_STATUS_REQUEST_CFM>;
    sendFrameAsync(frame: GW_WINK_SEND_REQ, timeout?: number): Promise<GW_WINK_SEND_CFM>;
    sendFrameAsync(frame: GW_SET_LIMITATION_REQ, timeout?: number): Promise<GW_SET_LIMITATION_CFM>;
    sendFrameAsync(frame: GW_GET_LIMITATION_STATUS_REQ, timeout?: number): Promise<GW_GET_LIMITATION_STATUS_CFM>;
    sendFrameAsync(frame: GW_MODE_SEND_REQ, timeout?: number): Promise<GW_MODE_SEND_CFM>;
    sendFrameAsync(frame: GW_INITIALIZE_SCENE_REQ, timeout?: number): Promise<GW_INITIALIZE_SCENE_CFM>;
    sendFrameAsync(frame: GW_INITIALIZE_SCENE_CANCEL_REQ, timeout?: number): Promise<GW_INITIALIZE_SCENE_CANCEL_CFM>;
    sendFrameAsync(frame: GW_RECORD_SCENE_REQ, timeout?: number): Promise<GW_RECORD_SCENE_CFM>;
    sendFrameAsync(frame: GW_DELETE_SCENE_REQ, timeout?: number): Promise<GW_DELETE_SCENE_CFM>;
    sendFrameAsync(frame: GW_RENAME_SCENE_REQ, timeout?: number): Promise<GW_RENAME_SCENE_CFM>;
    sendFrameAsync(frame: GW_GET_SCENE_LIST_REQ, timeout?: number): Promise<GW_GET_SCENE_LIST_CFM>;
    sendFrameAsync(frame: GW_GET_SCENE_INFORMATION_REQ, timeout?: number): Promise<GW_GET_SCENE_INFORMATION_CFM>;
    sendFrameAsync(frame: GW_ACTIVATE_SCENE_REQ, timeout?: number): Promise<GW_ACTIVATE_SCENE_CFM>;
    sendFrameAsync(frame: GW_STOP_SCENE_REQ, timeout?: number): Promise<GW_STOP_SCENE_CFM>;
    sendFrameAsync(frame: GW_ACTIVATE_PRODUCTGROUP_REQ, timeout?: number): Promise<GW_ACTIVATE_PRODUCTGROUP_CFM>;
    sendFrameAsync(frame: GW_GET_CONTACT_INPUT_LINK_LIST_REQ, timeout?: number): Promise<GW_GET_CONTACT_INPUT_LINK_LIST_CFM>;
    sendFrameAsync(frame: GW_SET_CONTACT_INPUT_LINK_REQ, timeout?: number): Promise<GW_SET_CONTACT_INPUT_LINK_CFM>;
    sendFrameAsync(frame: GW_REMOVE_CONTACT_INPUT_LINK_REQ, timeout?: number): Promise<GW_REMOVE_CONTACT_INPUT_LINK_CFM>;
    sendFrameAsync(frame: GW_GET_ACTIVATION_LOG_HEADER_REQ, timeout?: number): Promise<GW_GET_ACTIVATION_LOG_HEADER_CFM>;
    sendFrameAsync(frame: GW_CLEAR_ACTIVATION_LOG_REQ, timeout?: number): Promise<GW_CLEAR_ACTIVATION_LOG_CFM>;
    sendFrameAsync(frame: GW_GET_ACTIVATION_LOG_LINE_REQ, timeout?: number): Promise<GW_GET_ACTIVATION_LOG_LINE_CFM>;
    sendFrameAsync(frame: GW_GET_MULTIPLE_ACTIVATION_LOG_LINES_REQ, timeout?: number): Promise<GW_GET_MULTIPLE_ACTIVATION_LOG_LINES_CFM>;
    sendFrameAsync(frame: GW_SET_UTC_REQ, timeout?: number): Promise<GW_SET_UTC_CFM>;
    sendFrameAsync(frame: GW_RTC_SET_TIME_ZONE_REQ, timeout?: number): Promise<GW_RTC_SET_TIME_ZONE_CFM>;
    sendFrameAsync(frame: GW_GET_LOCAL_TIME_REQ, timeout?: number): Promise<GW_GET_LOCAL_TIME_CFM>;
    sendFrameAsync(frame: GW_PASSWORD_ENTER_REQ, timeout?: number): Promise<GW_PASSWORD_ENTER_CFM>;
    sendFrameAsync(frame: GW_PASSWORD_CHANGE_REQ, timeout?: number): Promise<GW_PASSWORD_CHANGE_CFM>;
    sendFrameAsync(frame: IGW_FRAME_REQ, timeout?: number): Promise<IGW_FRAME_RCV>;
}

Implemented by

Properties

KLF200SocketProtocol?: KLF200SocketProtocol

Gets the underlying socket protocol handler.

Methods

  • Logs in to the KLF interface by sending the GW_PASSWORD_ENTER_REQ.

    Parameters

    • password: string

      The password needed for login. The factory default password is velux123.

    • Optionaltimeout: number

      A timeout in seconds. After the timeout the returned promise will be rejected.

    Returns Promise<void>

    Returns a promise that resolves to true on success or rejects with the errors.

  • Logs out from the KLF interface and closes the socket.

    Parameters

    • Optionaltimeout: number

      A timeout in seconds. After the timeout the returned promise will be rejected.

    Returns Promise<void>

    Returns a promise that resolves to true on successful logout or rejects with the errors.

  • Add a handler to listen for confirmations and notification. You can provide an optional filter to listen only to specific events.

    Parameters

    • handler: Listener<IGW_FRAME_RCV>

      Callback functions that is called for an event

    • Optionalfilter: GatewayCommand[]

      Array of GatewayCommand entries you want to listen to. Optional.

    Returns Disposable

    Returns a Disposable that you can call to remove the handler.

  • Add a handler to listen for confirmations and notification. You can provide an optional filter to listen only to specific events.

    Parameters

    • handler: Listener<IGW_FRAME_REQ>

      Callback functions that is called for an event

    • Optionalfilter: GatewayCommand[]

      Array of GatewayCommand entries you want to listen to. Optional.

    Returns Disposable

    Returns a Disposable that you can call to remove the handler.