import { __esDecorate, __runInitializers } from "tslib";
import { CommandClasses, MessagePriority, TransmitOptions, } from "@zwave-js/core";
import { PhysicalCCAPI } from "../lib/API.js";
import { CommandClass } from "../lib/CommandClass.js";
import { API, commandClass, implementedVersion, } from "../lib/CommandClassDecorators.js";
// @noSetValueAPI This CC has no set-type commands
// @noInterview There's nothing to interview here
let NoOperationCCAPI = (() => {
    let _classDecorators = [API(CommandClasses["No Operation"])];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = PhysicalCCAPI;
    var NoOperationCCAPI = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            NoOperationCCAPI = _classThis = _classDescriptor.value;
            if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
            __runInitializers(_classThis, _classExtraInitializers);
        }
        async send() {
            await this.host.sendCommand(new NoOperationCC({
                nodeId: this.endpoint.nodeId,
                endpointIndex: this.endpoint.index,
            }), {
                // Unless instructed otherwise, don't try too hard to
                // reach the node. Pings are supposed to be short commands
                // and not block the send queue for multiple seconds.
                transmitOptions: TransmitOptions.ACK,
                ...this.commandOptions,
                // Don't retry sending ping packets
                maxSendAttempts: 1,
                // Pings have their own dedicated priority, since they
                // are used to test whether a node is awake/alive
                priority: MessagePriority.Ping,
            });
        }
    };
    return NoOperationCCAPI = _classThis;
})();
export { NoOperationCCAPI };
let NoOperationCC = (() => {
    let _classDecorators = [commandClass(CommandClasses["No Operation"]), implementedVersion(1)];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = CommandClass;
    var NoOperationCC = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            NoOperationCC = _classThis = _classDescriptor.value;
            if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
            __runInitializers(_classThis, _classExtraInitializers);
        }
    };
    return NoOperationCC = _classThis;
})();
export { NoOperationCC };
//# sourceMappingURL=NoOperationCC.js.map