Interface CompanionAdvancedFeedbackDefinition

The definition of an advanced feedback

interface CompanionAdvancedFeedbackDefinition {
    callback: ((feedback: CompanionFeedbackAdvancedEvent, context: CompanionCommonCallbackContext) => CompanionAdvancedFeedbackResult | Promise<CompanionAdvancedFeedbackResult>);
    description?: string;
    learn?: ((action: CompanionFeedbackInfo, context: CompanionCommonCallbackContext) => undefined | CompanionOptionValues | Promise<undefined | CompanionOptionValues>);
    learnTimeout?: number;
    name: string;
    options: SomeCompanionFeedbackInputField[];
    subscribe?: ((feedback: CompanionFeedbackInfo, context: CompanionCommonCallbackContext) => void | Promise<void>);
    type: "advanced";
    unsubscribe?: ((feedback: CompanionFeedbackInfo, context: CompanionCommonCallbackContext) => void | Promise<void>);
}

Hierarchy (view full)

Properties

callback: ((feedback: CompanionFeedbackAdvancedEvent, context: CompanionCommonCallbackContext) => CompanionAdvancedFeedbackResult | Promise<CompanionAdvancedFeedbackResult>)

Called to get the feedback value

description?: string

Additional description of the feedback

learn?: ((action: CompanionFeedbackInfo, context: CompanionCommonCallbackContext) => undefined | CompanionOptionValues | Promise<undefined | CompanionOptionValues>)

The user requested to 'learn' the values for this feedback.

learnTimeout?: number

Timeout for the 'learn' function (in milliseconds) Companion sets a default value of 5s, to ensure that the learn does not get stuck never completing You can change this if this number does not work for you, but you should keep it to a sensible value

name: string

Name to show in the feedbacks list

The input fields for the feedback

subscribe?: ((feedback: CompanionFeedbackInfo, context: CompanionCommonCallbackContext) => void | Promise<void>)

Called to report the existence of a feedback. Useful to ensure necessary data is loaded

type: "advanced"

The type of the feedback

unsubscribe?: ((feedback: CompanionFeedbackInfo, context: CompanionCommonCallbackContext) => void | Promise<void>)

Called to report an feedback has been edited/removed. Useful to cleanup subscriptions setup in subscribe