Svelte Wrapper for the @q-sys/qrwc library. Automatically connects to a Q-SYS Core and provides reactive control objects.

Hierarchy

  • ConnectionManager
    • QrwcSvelte

Constructors

  • Starts a new instance of the QRWC Wrapper. This will automatically connect to the specified Q-SYS core. Connection will be maintained until the instance is disconnected. This version of the constructor will connect via non-secure WebSocket, subscribe to all external components, and poll at 35ms.

    Parameters

    • coreIP: string

      The IP or Hostname of the core system to connect to.

    Returns QrwcSvelte

  • Starts a new instance of the QRWC Wrapper. This will automatically connect to the specified Q-SYS core. Connection will be maintained until the instance is disconnected. This version of the constructor allows for more advanced connection options.

    Parameters

    Returns QrwcSvelte

Properties

activeCore: "primary" | "redundant" = ...

$state The current active core. Can be "primary" or "redundant". This is a read-only property.

activeCoreState: "primary" | "redundant" = ...
connectionAttemptCount: number = ...

$state - The number of connection attempts made by the QRWC Wrapper.

connectionAttempts: number = ...
connectionState: ConnectionEvent = ...
connectionStatus: ConnectionEvent = ...

$state - The current state of the connection. "connecting" means the QRWC Wrapper is attempting to connect. "connected" means the QRWC Wrapper is ready to accept subscriptions. "disconnected" means the QRWC Wrapper is not connected to the QRWC WebSocket.

coreIp: string = ...

$state The current active core IP. This is a read-only property.

coreIpState: string = ...
isConnected: boolean = ...

$state - True if the connection is "connected", false otherwise.

qrwc: null | Qrwc = null

Methods

  • Manually disconnect the QRWC WebSocket, and no longer attempt to reconnect. This method should be called when the QRWC instance is no longer needed.

    This method will flush all subscriptions and disconnect the WebSocket. A new instance of the QRWC Wrapper will need to be created to reconnect.

    Any controls that were fetched will no longer be valid and will need to be re-fetched.

    Returns void

  • Get the list of components in the current Q-SYS design. Only returns components that have external script access, and are not excluded by a component filter passed into this wrapper instance.

    Returns string[]

    Array of component names with external script access in the current Q-SYS design.

  • Fetch a specific component in the current Q-SYS design. This will return a component instance that provides metadata and access to controls within the component. Controls within the component can be fetched using the appropriate use method.

    Parameters

    • componentId: string

      ID of the component to use. This is the "Code Name" under Script Access in Q-SYS Designer

    Returns Component

    component instance that provides metadata and access to controls within the component.

    If the component does not exist in the Q-SYS design or is excluded by the control filter.

MMNEPVFCICPMFPCPTTAAATR