Object.defineProperty(exports, "__esModule", { value: true });
var simpleCommandHandler_1 = require("../simpleCommandHandler");
module.exports = function (actionAPI) {
    actionAPI.handle(function (properties, status) {
        var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
        var numberValue = properties.number != undefined ? properties.number : 10;
        if (connectionID != 'none') {
            var connection = actionAPI.getConnection('viscaOverIpCamera', connectionID);
            if (connection != undefined && connection.instance != undefined) {
                if (connection.instance.internal != undefined)
                    connection.instance.internal = {};
                connection.instance.internal.pantiltSpeed = numberValue;
                status('Speed has been set', 'info');
            }
            else
                status('Not connected', 'error');
        }
        else
            status('No connection specified', 'error');
    });
    actionAPI.onOpenEditor(function (EditorAPI, properties) {
        var numberField = {
            id: 'number',
            name: 'Speed',
            type: 'select',
            value: properties.number != undefined ? properties.number : 1,
            values: []
        };
        for (var i = 0; i < 25; i++) {
            numberField.values.push({ id: String(i), text: String(i) });
        }
        (0, simpleCommandHandler_1.simpleCommandEditor)(EditorAPI, properties, [
            numberField
        ]);
    });
};
//# sourceMappingURL=panTiltSpeed.js.map