diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index 37f7795..1ab590a 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -1487,6 +1487,18 @@ export default class ClientConnection { ); } + public async EnumBlendingScene() { + return await this.doRpc( + new Protocol.EnumBlendingSceneRequestEntity() + ); + } + + public async ApplyBlendingScene(name: string) { + return await this.doRpc( + new Protocol.ApplyBlendingSceneRequestEntity(name) + ); + } + public destory() { this.ws?.close(); if (this.ws) { diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index be1d1d2..fc74613 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -526,6 +526,12 @@ export namespace Protocol { public static get kSetBlendingOption() { return Commands.PROTOCOL_PREFIX + "SetBlendingOption"; } + public static get kEnumBlendingScene() { + return Commands.PROTOCOL_PREFIX + "EnumBlendingScene"; + } + public static get kApplyBlendingScene() { + return Commands.PROTOCOL_PREFIX + "ApplyBlendingScene"; + } static _all_commands = new Set([ Commands.kUnKnowCommand, @@ -659,6 +665,8 @@ export namespace Protocol { Commands.kSetBlendingVerDensity, Commands.kResetBlending, Commands.kSetBlendingOption, + Commands.kEnumBlendingScene, + Commands.kApplyBlendingScene, ]); public static get AllCommands() { return this._all_commands; @@ -3484,4 +3492,39 @@ export namespace Protocol { id; value; } + + export class EnumBlendingSceneResponseEntity extends PacketEntity { + constructor() { + super(); + super.flag = PacketEntity.FLAG_RESPONSE; + } + + scenes = []; + } + + export class EnumBlendingSceneRequestEntity extends PacketEntity { + constructor( + rpc_id = 0 + ) { + super(); + super.command = Commands.kEnumBlendingScene; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + } + } + + export class ApplyBlendingSceneRequestEntity extends PacketEntity { + constructor( + name: string, + rpc_id = 0 + ) { + super(); + super.command = Commands.kApplyBlendingScene; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.name = name ?? ""; + } + name; + } }