import { CommandClasses } from "@zwave-js/core" ; import { MessagePriority } from "../message/Constants" ; import type { Message } from "../message/Message" ; import { PhysicalCCAPI } from "./API" ; import { API , CommandClass , commandClass , implementedVersion , } from "./CommandClass" ; import { isCommandClassContainer } from "./ICommandClassContainer" ; @ API ( CommandClasses [ "No Operation" ] ) export class NoOperationCCAPI extends PhysicalCCAPI { public async send ( ) { await this . driver . sendCommand ( new NoOperationCC ( this . driver , { nodeId : this . endpoint . nodeId , endpoint : this . endpoint . index } ) , { ... this . commandOptions , maxSendAttempts : 1 , priority : MessagePriority . Ping } ) ; } } @ commandClass ( CommandClasses [ "No Operation" ] ) @ implementedVersion ( 1 ) export class NoOperationCC extends CommandClass { declare ccCommand : undefined ; } /** Tests if a given message is a ping */ export function messageIsPing < T extends Message > ( msg ) { return isCommandClassContainer ( msg ) && msg . command instanceof NoOperationCC ; }