/* eslint-disable */ import * as _m0 from "protobufjs/minimal"; import Long = require("long"); export const protobufPackage = "BigAssFans"; export enum Direction { Forward = 0, Reverse = 1, } export function directionFromJSON(object: any): Direction { switch (object) { case 0: case "Forward": return Direction.Forward; case 1: case "Reverse": return Direction.Reverse; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum Direction"); } } export function directionToJSON(object: Direction): string { switch (object) { case Direction.Forward: return "Forward"; case Direction.Reverse: return "Reverse"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum Direction"); } } export enum OperatingMode { Off = 0, On = 1, Auto = 2, } export function operatingModeFromJSON(object: any): OperatingMode { switch (object) { case 0: case "Off": return OperatingMode.Off; case 1: case "On": return OperatingMode.On; case 2: case "Auto": return OperatingMode.Auto; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum OperatingMode"); } } export function operatingModeToJSON(object: OperatingMode): string { switch (object) { case OperatingMode.Off: return "Off"; case OperatingMode.On: return "On"; case OperatingMode.Auto: return "Auto"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum OperatingMode"); } } export enum MultipleLightMode { AllLights = 0, Downlight = 1, Uplight = 2, } export function multipleLightModeFromJSON(object: any): MultipleLightMode { switch (object) { case 0: case "AllLights": return MultipleLightMode.AllLights; case 1: case "Downlight": return MultipleLightMode.Downlight; case 2: case "Uplight": return MultipleLightMode.Uplight; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum MultipleLightMode"); } } export function multipleLightModeToJSON(object: MultipleLightMode): string { switch (object) { case MultipleLightMode.AllLights: return "AllLights"; case MultipleLightMode.Downlight: return "Downlight"; case MultipleLightMode.Uplight: return "Uplight"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum MultipleLightMode"); } } export enum Day { NoDay = 0, Sunday = 1, Monday = 2, Tuesday = 3, Wednesday = 4, Thursday = 5, Friday = 6, Saturday = 7, } export function dayFromJSON(object: any): Day { switch (object) { case 0: case "NoDay": return Day.NoDay; case 1: case "Sunday": return Day.Sunday; case 2: case "Monday": return Day.Monday; case 3: case "Tuesday": return Day.Tuesday; case 4: case "Wednesday": return Day.Wednesday; case 5: case "Thursday": return Day.Thursday; case 6: case "Friday": return Day.Friday; case 7: case "Saturday": return Day.Saturday; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum Day"); } } export function dayToJSON(object: Day): string { switch (object) { case Day.NoDay: return "NoDay"; case Day.Sunday: return "Sunday"; case Day.Monday: return "Monday"; case Day.Tuesday: return "Tuesday"; case Day.Wednesday: return "Wednesday"; case Day.Thursday: return "Thursday"; case Day.Friday: return "Friday"; case Day.Saturday: return "Saturday"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum Day"); } } export enum RebootReason { Unknown = 0, Other = 1, PowerOn = 2, Software = 3, IndependentWatchdog = 4, TaskWatchdog = 5, BrownOut = 6, LowPower = 7, Lockup = 8, Pin = 9, } export function rebootReasonFromJSON(object: any): RebootReason { switch (object) { case 0: case "Unknown": return RebootReason.Unknown; case 1: case "Other": return RebootReason.Other; case 2: case "PowerOn": return RebootReason.PowerOn; case 3: case "Software": return RebootReason.Software; case 4: case "IndependentWatchdog": return RebootReason.IndependentWatchdog; case 5: case "TaskWatchdog": return RebootReason.TaskWatchdog; case 6: case "BrownOut": return RebootReason.BrownOut; case 7: case "LowPower": return RebootReason.LowPower; case 8: case "Lockup": return RebootReason.Lockup; case 9: case "Pin": return RebootReason.Pin; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum RebootReason"); } } export function rebootReasonToJSON(object: RebootReason): string { switch (object) { case RebootReason.Unknown: return "Unknown"; case RebootReason.Other: return "Other"; case RebootReason.PowerOn: return "PowerOn"; case RebootReason.Software: return "Software"; case RebootReason.IndependentWatchdog: return "IndependentWatchdog"; case RebootReason.TaskWatchdog: return "TaskWatchdog"; case RebootReason.BrownOut: return "BrownOut"; case RebootReason.LowPower: return "LowPower"; case RebootReason.Lockup: return "Lockup"; case RebootReason.Pin: return "Pin"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum RebootReason"); } } export enum AssistWith { Nothing = 0, Heating = 1, Cooling = 2, All = 3, } export function assistWithFromJSON(object: any): AssistWith { switch (object) { case 0: case "Nothing": return AssistWith.Nothing; case 1: case "Heating": return AssistWith.Heating; case 2: case "Cooling": return AssistWith.Cooling; case 3: case "All": return AssistWith.All; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum AssistWith"); } } export function assistWithToJSON(object: AssistWith): string { switch (object) { case AssistWith.Nothing: return "Nothing"; case AssistWith.Heating: return "Heating"; case AssistWith.Cooling: return "Cooling"; case AssistWith.All: return "All"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum AssistWith"); } } export enum FirmwareType { Host = 0, Wifi = 1, Light = 2, Motor = 3, } export function firmwareTypeFromJSON(object: any): FirmwareType { switch (object) { case 0: case "Host": return FirmwareType.Host; case 1: case "Wifi": return FirmwareType.Wifi; case 2: case "Light": return FirmwareType.Light; case 3: case "Motor": return FirmwareType.Motor; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FirmwareType"); } } export function firmwareTypeToJSON(object: FirmwareType): string { switch (object) { case FirmwareType.Host: return "Host"; case FirmwareType.Wifi: return "Wifi"; case FirmwareType.Light: return "Light"; case FirmwareType.Motor: return "Motor"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FirmwareType"); } } export enum ExternalDeviceType { BleRemote = 0, BleWallControl = 1, UnknownDevice = 2, } export function externalDeviceTypeFromJSON(object: any): ExternalDeviceType { switch (object) { case 0: case "BleRemote": return ExternalDeviceType.BleRemote; case 1: case "BleWallControl": return ExternalDeviceType.BleWallControl; case 2: case "UnknownDevice": return ExternalDeviceType.UnknownDevice; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum ExternalDeviceType"); } } export function externalDeviceTypeToJSON(object: ExternalDeviceType): string { switch (object) { case ExternalDeviceType.BleRemote: return "BleRemote"; case ExternalDeviceType.BleWallControl: return "BleWallControl"; case ExternalDeviceType.UnknownDevice: return "UnknownDevice"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum ExternalDeviceType"); } } export interface ApiMessage { inner: Payload | undefined; } export interface Payload { job?: Job | undefined; query?: Query | undefined; update?: Update | undefined; } export interface Job { systemAction: SystemAction | undefined; commands: Property[]; scheduleJob: ScheduleJob[]; } export interface Update { properties: Property[]; scheduleJob: ScheduleJob | undefined; } export interface Query { type: Query_Type; } export enum Query_Type { All = 0, Fan = 1, Light = 2, Device = 3, Network = 4, Schedules = 5, Sensor = 6, } export function query_TypeFromJSON(object: any): Query_Type { switch (object) { case 0: case "All": return Query_Type.All; case 1: case "Fan": return Query_Type.Fan; case 2: case "Light": return Query_Type.Light; case 3: case "Device": return Query_Type.Device; case 4: case "Network": return Query_Type.Network; case 5: case "Schedules": return Query_Type.Schedules; case 6: case "Sensor": return Query_Type.Sensor; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum Query_Type"); } } export function query_TypeToJSON(object: Query_Type): string { switch (object) { case Query_Type.All: return "All"; case Query_Type.Fan: return "Fan"; case Query_Type.Light: return "Light"; case Query_Type.Device: return "Device"; case Query_Type.Network: return "Network"; case Query_Type.Schedules: return "Schedules"; case Query_Type.Sensor: return "Sensor"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum Query_Type"); } } export interface SystemAction { command: SystemAction_Command; remoteData?: RemoteCommandData | undefined; } export enum SystemAction_Command { NoAction = 0, Reboot = 2, StartAudibleSignal = 4, StartVisibleSignal = 5, ForgetRemote = 8, ResumeFanMode = 11, ResumeLightMode = 12, } export function systemAction_CommandFromJSON(object: any): SystemAction_Command { switch (object) { case 0: case "NoAction": return SystemAction_Command.NoAction; case 2: case "Reboot": return SystemAction_Command.Reboot; case 4: case "StartAudibleSignal": return SystemAction_Command.StartAudibleSignal; case 5: case "StartVisibleSignal": return SystemAction_Command.StartVisibleSignal; case 8: case "ForgetRemote": return SystemAction_Command.ForgetRemote; case 11: case "ResumeFanMode": return SystemAction_Command.ResumeFanMode; case 12: case "ResumeLightMode": return SystemAction_Command.ResumeLightMode; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum SystemAction_Command"); } } export function systemAction_CommandToJSON(object: SystemAction_Command): string { switch (object) { case SystemAction_Command.NoAction: return "NoAction"; case SystemAction_Command.Reboot: return "Reboot"; case SystemAction_Command.StartAudibleSignal: return "StartAudibleSignal"; case SystemAction_Command.StartVisibleSignal: return "StartVisibleSignal"; case SystemAction_Command.ForgetRemote: return "ForgetRemote"; case SystemAction_Command.ResumeFanMode: return "ResumeFanMode"; case SystemAction_Command.ResumeLightMode: return "ResumeLightMode"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum SystemAction_Command"); } } export interface RemoteCommandData { address: string; } export interface Property { name?: string | undefined; model?: string | undefined; localTime?: string | undefined; utcTime?: string | undefined; timeZone?: string | undefined; fwVersion?: string | undefined; macAddress?: string | undefined; cloudId?: string | undefined; deviceId?: string | undefined; cloudServerUrl?: string | undefined; apiVersion?: string | undefined; deviceTypeId?: number | undefined; detailedVersion?: DetailedVersion | undefined; deviceCapabilities?: DeviceCapabilities | undefined; pcbaPartNumber?: string | undefined; pcbaRevision?: string | undefined; fanMode?: OperatingMode | undefined; fanDirection?: Direction | undefined; fanPercent?: number | undefined; fanSpeed?: number | undefined; comfortSenseEnabled?: boolean | undefined; comfortSenseIdealTemp?: number | undefined; comfortSenseMinSpeed?: number | undefined; comfortSenseMaxSpeed?: number | undefined; fanOccupancyEnabled?: boolean | undefined; fanOccupancyTimeout?: number | undefined; fanReturnToAutoEnabled?: boolean | undefined; fanReturnToAutoTimeout?: number | undefined; whooshEnabled?: boolean | undefined; comfortSenseHeatAssistEnabled?: boolean | undefined; comfortSenseHeatAssistSpeed?: number | undefined; comfortSenseHeatAssistDirection?: Direction | undefined; commandedRpm?: number | undefined; actualRpm?: number | undefined; ecoModeEnabled?: boolean | undefined; fanOccupied?: boolean | undefined; fanOnMeansAuto?: boolean | undefined; lightMode?: OperatingMode | undefined; lightPercent?: number | undefined; lightLevel?: number | undefined; lightColorTemperature?: number | undefined; lightOccupancyEnabled?: boolean | undefined; lightOccupancyTimeout?: number | undefined; lightReturnToAutoEnabled?: boolean | undefined; lightReturnToAutoTimeout?: number | undefined; lightDimToWarmEnabled?: boolean | undefined; lightColorTemperatureMin?: number | undefined; lightColorTemperatureMax?: number | undefined; multipleLightMode?: MultipleLightMode | undefined; standbyLed?: StandbyLed | undefined; lightOccupied?: boolean | undefined; temperature?: number | undefined; humidity?: number | undefined; fanTimerMinutes?: number | undefined; fanTimerUtcExpiration?: number | undefined; lightOnMeansAuto?: boolean | undefined; ipAddress?: Uint8Array | undefined; network?: Network | undefined; indicatorsEnabled?: boolean | undefined; audibleIndicatorEnabled?: boolean | undefined; legacyIrEnabled?: boolean | undefined; wallControlConfiguration?: WallControlConfiguration | undefined; assistWith?: AssistWith | undefined; remoteDiscoveryEnabled?: boolean | undefined; externalDeviceCount?: number | undefined; externalDeviceVersion?: ExternalDeviceVersion | undefined; bleRemoteSupported?: boolean | undefined; debugInfo?: DebugInfo | undefined; groupContainer?: GroupContainer | undefined; uvcEnabled?: boolean | undefined; uvcLife?: number | undefined; } export interface Network { ssid: Uint8Array; } export interface WallControlConfiguration { topButtonFunction: WallControlConfiguration_Function; bottomButtonFunction: WallControlConfiguration_Function; } export enum WallControlConfiguration_Function { NoFunction = 0, LightLevel = 1, LightColor = 2, FanSpeed = 3, } export function wallControlConfiguration_FunctionFromJSON(object: any): WallControlConfiguration_Function { switch (object) { case 0: case "NoFunction": return WallControlConfiguration_Function.NoFunction; case 1: case "LightLevel": return WallControlConfiguration_Function.LightLevel; case 2: case "LightColor": return WallControlConfiguration_Function.LightColor; case 3: case "FanSpeed": return WallControlConfiguration_Function.FanSpeed; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum WallControlConfiguration_Function"); } } export function wallControlConfiguration_FunctionToJSON(object: WallControlConfiguration_Function): string { switch (object) { case WallControlConfiguration_Function.NoFunction: return "NoFunction"; case WallControlConfiguration_Function.LightLevel: return "LightLevel"; case WallControlConfiguration_Function.LightColor: return "LightColor"; case WallControlConfiguration_Function.FanSpeed: return "FanSpeed"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum WallControlConfiguration_Function"); } } export interface DebugInfo { uptimeMinutes: number; rebootCountTotal: number; rebootCountSincePor: number; lastRebootReason: RebootReason; lastRebootDetails: number; softwareError: number; softwareErrorDetails: number; } export interface DetailedVersion { type: FirmwareType; appVersion: string; bootloaderVersion: string; } export interface ExternalDeviceVersion { type: ExternalDeviceType; packageVersion: string; bootloaderVersion: string; macAddress: string; rebootReason: RebootReason; } export interface GroupContainer { uuid: Uint8Array; name: string; } export interface StandbyLed { colorPreset: StandbyLed_ColorPreset; enabled: boolean; percent: number; red: number; green: number; blue: number; } export enum StandbyLed_ColorPreset { Custom = 0, Red = 1, Green = 2, Blue = 3, Teal = 4, Yellow = 5, Violet = 6, White = 7, Orange = 8, Pink = 9, } export function standbyLed_ColorPresetFromJSON(object: any): StandbyLed_ColorPreset { switch (object) { case 0: case "Custom": return StandbyLed_ColorPreset.Custom; case 1: case "Red": return StandbyLed_ColorPreset.Red; case 2: case "Green": return StandbyLed_ColorPreset.Green; case 3: case "Blue": return StandbyLed_ColorPreset.Blue; case 4: case "Teal": return StandbyLed_ColorPreset.Teal; case 5: case "Yellow": return StandbyLed_ColorPreset.Yellow; case 6: case "Violet": return StandbyLed_ColorPreset.Violet; case 7: case "White": return StandbyLed_ColorPreset.White; case 8: case "Orange": return StandbyLed_ColorPreset.Orange; case 9: case "Pink": return StandbyLed_ColorPreset.Pink; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum StandbyLed_ColorPreset"); } } export function standbyLed_ColorPresetToJSON(object: StandbyLed_ColorPreset): string { switch (object) { case StandbyLed_ColorPreset.Custom: return "Custom"; case StandbyLed_ColorPreset.Red: return "Red"; case StandbyLed_ColorPreset.Green: return "Green"; case StandbyLed_ColorPreset.Blue: return "Blue"; case StandbyLed_ColorPreset.Teal: return "Teal"; case StandbyLed_ColorPreset.Yellow: return "Yellow"; case StandbyLed_ColorPreset.Violet: return "Violet"; case StandbyLed_ColorPreset.White: return "White"; case StandbyLed_ColorPreset.Orange: return "Orange"; case StandbyLed_ColorPreset.Pink: return "Pink"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum StandbyLed_ColorPreset"); } } export interface DeviceCapabilities { hasTempSensor: boolean; hasHumiditySensor: boolean; hasOccupancySensor: boolean; hasLight: boolean; hasLightSensor: boolean; hasColorTempControl: boolean; hasFan: boolean; hasSpeaker: boolean; hasPiezo: boolean; hasLedIndicators: boolean; hasUplight: boolean; hasUvcLight: boolean; hasStandbyLed: boolean; hasEcoMode: boolean; } export interface ScheduleProperty { fanMode?: OperatingMode | undefined; fanDirection?: Direction | undefined; fanSpeed?: number | undefined; fanPercent?: number | undefined; lightMode?: OperatingMode | undefined; lightLevel?: number | undefined; lightColorTemperature?: number | undefined; lightPercent?: number | undefined; uplightPercent?: number | undefined; multipleLightMode?: MultipleLightMode | undefined; comfortSenseEnabled?: boolean | undefined; comfortSenseIdealTemp?: number | undefined; comfortSenseMinSpeed?: number | undefined; comfortSenseMaxSpeed?: number | undefined; fanOccupancyEnabled?: boolean | undefined; fanOccupancyTimeout?: number | undefined; lightOccupancyEnabled?: boolean | undefined; lightOccupancyTimeout?: number | undefined; } export interface ScheduleJob { action: ScheduleJob_Action; schedule: ScheduleJob_Schedule | undefined; schedulesCount: number; schedulesMax: number; } export enum ScheduleJob_Action { NoAction = 0, Update = 1, Remove = 2, Read = 3, } export function scheduleJob_ActionFromJSON(object: any): ScheduleJob_Action { switch (object) { case 0: case "NoAction": return ScheduleJob_Action.NoAction; case 1: case "Update": return ScheduleJob_Action.Update; case 2: case "Remove": return ScheduleJob_Action.Remove; case 3: case "Read": return ScheduleJob_Action.Read; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum ScheduleJob_Action"); } } export function scheduleJob_ActionToJSON(object: ScheduleJob_Action): string { switch (object) { case ScheduleJob_Action.NoAction: return "NoAction"; case ScheduleJob_Action.Update: return "Update"; case ScheduleJob_Action.Remove: return "Remove"; case ScheduleJob_Action.Read: return "Read"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum ScheduleJob_Action"); } } export interface ScheduleJob_Schedule { id: number; name: string; devices: Uint8Array[]; days: Day[]; isEnabled: boolean; startEvent: ScheduleJob_Schedule_ScheduleEvent | undefined; endEvent: ScheduleJob_Schedule_ScheduleEvent | undefined; } export interface ScheduleJob_Schedule_ScheduleEvent { time: string; properties: ScheduleProperty[]; } function createBaseApiMessage(): ApiMessage { return { inner: undefined }; } export const ApiMessage = { encode(message: ApiMessage, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.inner !== undefined) { Payload.encode(message.inner, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ApiMessage { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseApiMessage(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: if (tag !== 18) { break; } message.inner = Payload.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): ApiMessage { return { inner: isSet(object.inner) ? Payload.fromJSON(object.inner) : undefined }; }, toJSON(message: ApiMessage): unknown { const obj: any = {}; if (message.inner !== undefined) { obj.inner = Payload.toJSON(message.inner); } return obj; }, create, I>>(base?: I): ApiMessage { return ApiMessage.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): ApiMessage { const message = createBaseApiMessage(); message.inner = (object.inner !== undefined && object.inner !== null) ? Payload.fromPartial(object.inner) : undefined; return message; }, }; function createBasePayload(): Payload { return { job: undefined, query: undefined, update: undefined }; } export const Payload = { encode(message: Payload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.job !== undefined) { Job.encode(message.job, writer.uint32(18).fork()).ldelim(); } if (message.query !== undefined) { Query.encode(message.query, writer.uint32(26).fork()).ldelim(); } if (message.update !== undefined) { Update.encode(message.update, writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Payload { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePayload(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: if (tag !== 18) { break; } message.job = Job.decode(reader, reader.uint32()); continue; case 3: if (tag !== 26) { break; } message.query = Query.decode(reader, reader.uint32()); continue; case 4: if (tag !== 34) { break; } message.update = Update.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): Payload { return { job: isSet(object.job) ? Job.fromJSON(object.job) : undefined, query: isSet(object.query) ? Query.fromJSON(object.query) : undefined, update: isSet(object.update) ? Update.fromJSON(object.update) : undefined, }; }, toJSON(message: Payload): unknown { const obj: any = {}; if (message.job !== undefined) { obj.job = Job.toJSON(message.job); } if (message.query !== undefined) { obj.query = Query.toJSON(message.query); } if (message.update !== undefined) { obj.update = Update.toJSON(message.update); } return obj; }, create, I>>(base?: I): Payload { return Payload.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): Payload { const message = createBasePayload(); message.job = (object.job !== undefined && object.job !== null) ? Job.fromPartial(object.job) : undefined; message.query = (object.query !== undefined && object.query !== null) ? Query.fromPartial(object.query) : undefined; message.update = (object.update !== undefined && object.update !== null) ? Update.fromPartial(object.update) : undefined; return message; }, }; function createBaseJob(): Job { return { systemAction: undefined, commands: [], scheduleJob: [] }; } export const Job = { encode(message: Job, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.systemAction !== undefined) { SystemAction.encode(message.systemAction, writer.uint32(18).fork()).ldelim(); } for (const v of message.commands) { Property.encode(v!, writer.uint32(26).fork()).ldelim(); } for (const v of message.scheduleJob) { ScheduleJob.encode(v!, writer.uint32(34).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Job { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseJob(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: if (tag !== 18) { break; } message.systemAction = SystemAction.decode(reader, reader.uint32()); continue; case 3: if (tag !== 26) { break; } message.commands.push(Property.decode(reader, reader.uint32())); continue; case 4: if (tag !== 34) { break; } message.scheduleJob.push(ScheduleJob.decode(reader, reader.uint32())); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): Job { return { systemAction: isSet(object.systemAction) ? SystemAction.fromJSON(object.systemAction) : undefined, commands: globalThis.Array.isArray(object?.commands) ? object.commands.map((e: any) => Property.fromJSON(e)) : [], scheduleJob: globalThis.Array.isArray(object?.scheduleJob) ? object.scheduleJob.map((e: any) => ScheduleJob.fromJSON(e)) : [], }; }, toJSON(message: Job): unknown { const obj: any = {}; if (message.systemAction !== undefined) { obj.systemAction = SystemAction.toJSON(message.systemAction); } if (message.commands?.length) { obj.commands = message.commands.map((e) => Property.toJSON(e)); } if (message.scheduleJob?.length) { obj.scheduleJob = message.scheduleJob.map((e) => ScheduleJob.toJSON(e)); } return obj; }, create, I>>(base?: I): Job { return Job.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): Job { const message = createBaseJob(); message.systemAction = (object.systemAction !== undefined && object.systemAction !== null) ? SystemAction.fromPartial(object.systemAction) : undefined; message.commands = object.commands?.map((e) => Property.fromPartial(e)) || []; message.scheduleJob = object.scheduleJob?.map((e) => ScheduleJob.fromPartial(e)) || []; return message; }, }; function createBaseUpdate(): Update { return { properties: [], scheduleJob: undefined }; } export const Update = { encode(message: Update, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.properties) { Property.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.scheduleJob !== undefined) { ScheduleJob.encode(message.scheduleJob, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Update { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUpdate(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: if (tag !== 18) { break; } message.properties.push(Property.decode(reader, reader.uint32())); continue; case 3: if (tag !== 26) { break; } message.scheduleJob = ScheduleJob.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): Update { return { properties: globalThis.Array.isArray(object?.properties) ? object.properties.map((e: any) => Property.fromJSON(e)) : [], scheduleJob: isSet(object.scheduleJob) ? ScheduleJob.fromJSON(object.scheduleJob) : undefined, }; }, toJSON(message: Update): unknown { const obj: any = {}; if (message.properties?.length) { obj.properties = message.properties.map((e) => Property.toJSON(e)); } if (message.scheduleJob !== undefined) { obj.scheduleJob = ScheduleJob.toJSON(message.scheduleJob); } return obj; }, create, I>>(base?: I): Update { return Update.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): Update { const message = createBaseUpdate(); message.properties = object.properties?.map((e) => Property.fromPartial(e)) || []; message.scheduleJob = (object.scheduleJob !== undefined && object.scheduleJob !== null) ? ScheduleJob.fromPartial(object.scheduleJob) : undefined; return message; }, }; function createBaseQuery(): Query { return { type: 0 }; } export const Query = { encode(message: Query, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { writer.uint32(8).int32(message.type); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Query { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuery(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.type = reader.int32() as any; continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): Query { return { type: isSet(object.type) ? query_TypeFromJSON(object.type) : 0 }; }, toJSON(message: Query): unknown { const obj: any = {}; if (message.type !== 0) { obj.type = query_TypeToJSON(message.type); } return obj; }, create, I>>(base?: I): Query { return Query.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): Query { const message = createBaseQuery(); message.type = object.type ?? 0; return message; }, }; function createBaseSystemAction(): SystemAction { return { command: 0, remoteData: undefined }; } export const SystemAction = { encode(message: SystemAction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.command !== 0) { writer.uint32(8).int32(message.command); } if (message.remoteData !== undefined) { RemoteCommandData.encode(message.remoteData, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): SystemAction { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSystemAction(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.command = reader.int32() as any; continue; case 3: if (tag !== 26) { break; } message.remoteData = RemoteCommandData.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): SystemAction { return { command: isSet(object.command) ? systemAction_CommandFromJSON(object.command) : 0, remoteData: isSet(object.remoteData) ? RemoteCommandData.fromJSON(object.remoteData) : undefined, }; }, toJSON(message: SystemAction): unknown { const obj: any = {}; if (message.command !== 0) { obj.command = systemAction_CommandToJSON(message.command); } if (message.remoteData !== undefined) { obj.remoteData = RemoteCommandData.toJSON(message.remoteData); } return obj; }, create, I>>(base?: I): SystemAction { return SystemAction.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): SystemAction { const message = createBaseSystemAction(); message.command = object.command ?? 0; message.remoteData = (object.remoteData !== undefined && object.remoteData !== null) ? RemoteCommandData.fromPartial(object.remoteData) : undefined; return message; }, }; function createBaseRemoteCommandData(): RemoteCommandData { return { address: "" }; } export const RemoteCommandData = { encode(message: RemoteCommandData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.address !== "") { writer.uint32(18).string(message.address); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): RemoteCommandData { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRemoteCommandData(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: if (tag !== 18) { break; } message.address = reader.string(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): RemoteCommandData { return { address: isSet(object.address) ? globalThis.String(object.address) : "" }; }, toJSON(message: RemoteCommandData): unknown { const obj: any = {}; if (message.address !== "") { obj.address = message.address; } return obj; }, create, I>>(base?: I): RemoteCommandData { return RemoteCommandData.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): RemoteCommandData { const message = createBaseRemoteCommandData(); message.address = object.address ?? ""; return message; }, }; function createBaseProperty(): Property { return { name: undefined, model: undefined, localTime: undefined, utcTime: undefined, timeZone: undefined, fwVersion: undefined, macAddress: undefined, cloudId: undefined, deviceId: undefined, cloudServerUrl: undefined, apiVersion: undefined, deviceTypeId: undefined, detailedVersion: undefined, deviceCapabilities: undefined, pcbaPartNumber: undefined, pcbaRevision: undefined, fanMode: undefined, fanDirection: undefined, fanPercent: undefined, fanSpeed: undefined, comfortSenseEnabled: undefined, comfortSenseIdealTemp: undefined, comfortSenseMinSpeed: undefined, comfortSenseMaxSpeed: undefined, fanOccupancyEnabled: undefined, fanOccupancyTimeout: undefined, fanReturnToAutoEnabled: undefined, fanReturnToAutoTimeout: undefined, whooshEnabled: undefined, comfortSenseHeatAssistEnabled: undefined, comfortSenseHeatAssistSpeed: undefined, comfortSenseHeatAssistDirection: undefined, commandedRpm: undefined, actualRpm: undefined, ecoModeEnabled: undefined, fanOccupied: undefined, fanOnMeansAuto: undefined, lightMode: undefined, lightPercent: undefined, lightLevel: undefined, lightColorTemperature: undefined, lightOccupancyEnabled: undefined, lightOccupancyTimeout: undefined, lightReturnToAutoEnabled: undefined, lightReturnToAutoTimeout: undefined, lightDimToWarmEnabled: undefined, lightColorTemperatureMin: undefined, lightColorTemperatureMax: undefined, multipleLightMode: undefined, standbyLed: undefined, lightOccupied: undefined, temperature: undefined, humidity: undefined, fanTimerMinutes: undefined, fanTimerUtcExpiration: undefined, lightOnMeansAuto: undefined, ipAddress: undefined, network: undefined, indicatorsEnabled: undefined, audibleIndicatorEnabled: undefined, legacyIrEnabled: undefined, wallControlConfiguration: undefined, assistWith: undefined, remoteDiscoveryEnabled: undefined, externalDeviceCount: undefined, externalDeviceVersion: undefined, bleRemoteSupported: undefined, debugInfo: undefined, groupContainer: undefined, uvcEnabled: undefined, uvcLife: undefined, }; } export const Property = { encode(message: Property, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.name !== undefined) { writer.uint32(10).string(message.name); } if (message.model !== undefined) { writer.uint32(18).string(message.model); } if (message.localTime !== undefined) { writer.uint32(34).string(message.localTime); } if (message.utcTime !== undefined) { writer.uint32(42).string(message.utcTime); } if (message.timeZone !== undefined) { writer.uint32(50).string(message.timeZone); } if (message.fwVersion !== undefined) { writer.uint32(58).string(message.fwVersion); } if (message.macAddress !== undefined) { writer.uint32(66).string(message.macAddress); } if (message.cloudId !== undefined) { writer.uint32(74).string(message.cloudId); } if (message.deviceId !== undefined) { writer.uint32(82).string(message.deviceId); } if (message.cloudServerUrl !== undefined) { writer.uint32(90).string(message.cloudServerUrl); } if (message.apiVersion !== undefined) { writer.uint32(106).string(message.apiVersion); } if (message.deviceTypeId !== undefined) { writer.uint32(120).uint32(message.deviceTypeId); } if (message.detailedVersion !== undefined) { DetailedVersion.encode(message.detailedVersion, writer.uint32(130).fork()).ldelim(); } if (message.deviceCapabilities !== undefined) { DeviceCapabilities.encode(message.deviceCapabilities, writer.uint32(138).fork()).ldelim(); } if (message.pcbaPartNumber !== undefined) { writer.uint32(298).string(message.pcbaPartNumber); } if (message.pcbaRevision !== undefined) { writer.uint32(306).string(message.pcbaRevision); } if (message.fanMode !== undefined) { writer.uint32(344).int32(message.fanMode); } if (message.fanDirection !== undefined) { writer.uint32(352).int32(message.fanDirection); } if (message.fanPercent !== undefined) { writer.uint32(360).uint32(message.fanPercent); } if (message.fanSpeed !== undefined) { writer.uint32(368).uint32(message.fanSpeed); } if (message.comfortSenseEnabled !== undefined) { writer.uint32(376).bool(message.comfortSenseEnabled); } if (message.comfortSenseIdealTemp !== undefined) { writer.uint32(384).uint32(message.comfortSenseIdealTemp); } if (message.comfortSenseMinSpeed !== undefined) { writer.uint32(400).uint32(message.comfortSenseMinSpeed); } if (message.comfortSenseMaxSpeed !== undefined) { writer.uint32(408).uint32(message.comfortSenseMaxSpeed); } if (message.fanOccupancyEnabled !== undefined) { writer.uint32(416).bool(message.fanOccupancyEnabled); } if (message.fanOccupancyTimeout !== undefined) { writer.uint32(424).uint32(message.fanOccupancyTimeout); } if (message.fanReturnToAutoEnabled !== undefined) { writer.uint32(432).bool(message.fanReturnToAutoEnabled); } if (message.fanReturnToAutoTimeout !== undefined) { writer.uint32(440).uint32(message.fanReturnToAutoTimeout); } if (message.whooshEnabled !== undefined) { writer.uint32(464).bool(message.whooshEnabled); } if (message.comfortSenseHeatAssistEnabled !== undefined) { writer.uint32(480).bool(message.comfortSenseHeatAssistEnabled); } if (message.comfortSenseHeatAssistSpeed !== undefined) { writer.uint32(488).uint32(message.comfortSenseHeatAssistSpeed); } if (message.comfortSenseHeatAssistDirection !== undefined) { writer.uint32(496).int32(message.comfortSenseHeatAssistDirection); } if (message.commandedRpm !== undefined) { writer.uint32(504).uint32(message.commandedRpm); } if (message.actualRpm !== undefined) { writer.uint32(512).uint32(message.actualRpm); } if (message.ecoModeEnabled !== undefined) { writer.uint32(520).bool(message.ecoModeEnabled); } if (message.fanOccupied !== undefined) { writer.uint32(528).bool(message.fanOccupied); } if (message.fanOnMeansAuto !== undefined) { writer.uint32(536).bool(message.fanOnMeansAuto); } if (message.lightMode !== undefined) { writer.uint32(544).int32(message.lightMode); } if (message.lightPercent !== undefined) { writer.uint32(552).uint32(message.lightPercent); } if (message.lightLevel !== undefined) { writer.uint32(560).uint32(message.lightLevel); } if (message.lightColorTemperature !== undefined) { writer.uint32(568).uint32(message.lightColorTemperature); } if (message.lightOccupancyEnabled !== undefined) { writer.uint32(576).bool(message.lightOccupancyEnabled); } if (message.lightOccupancyTimeout !== undefined) { writer.uint32(584).uint32(message.lightOccupancyTimeout); } if (message.lightReturnToAutoEnabled !== undefined) { writer.uint32(592).bool(message.lightReturnToAutoEnabled); } if (message.lightReturnToAutoTimeout !== undefined) { writer.uint32(600).uint32(message.lightReturnToAutoTimeout); } if (message.lightDimToWarmEnabled !== undefined) { writer.uint32(616).bool(message.lightDimToWarmEnabled); } if (message.lightColorTemperatureMin !== undefined) { writer.uint32(624).uint32(message.lightColorTemperatureMin); } if (message.lightColorTemperatureMax !== undefined) { writer.uint32(632).uint32(message.lightColorTemperatureMax); } if (message.multipleLightMode !== undefined) { writer.uint32(656).int32(message.multipleLightMode); } if (message.standbyLed !== undefined) { StandbyLed.encode(message.standbyLed, writer.uint32(666).fork()).ldelim(); } if (message.lightOccupied !== undefined) { writer.uint32(680).bool(message.lightOccupied); } if (message.temperature !== undefined) { writer.uint32(688).uint32(message.temperature); } if (message.humidity !== undefined) { writer.uint32(696).uint32(message.humidity); } if (message.fanTimerMinutes !== undefined) { writer.uint32(760).uint32(message.fanTimerMinutes); } if (message.fanTimerUtcExpiration !== undefined) { writer.uint32(768).int64(message.fanTimerUtcExpiration); } if (message.lightOnMeansAuto !== undefined) { writer.uint32(872).bool(message.lightOnMeansAuto); } if (message.ipAddress !== undefined) { writer.uint32(962).bytes(message.ipAddress); } if (message.network !== undefined) { Network.encode(message.network, writer.uint32(994).fork()).ldelim(); } if (message.indicatorsEnabled !== undefined) { writer.uint32(1072).bool(message.indicatorsEnabled); } if (message.audibleIndicatorEnabled !== undefined) { writer.uint32(1080).bool(message.audibleIndicatorEnabled); } if (message.legacyIrEnabled !== undefined) { writer.uint32(1088).bool(message.legacyIrEnabled); } if (message.wallControlConfiguration !== undefined) { WallControlConfiguration.encode(message.wallControlConfiguration, writer.uint32(1114).fork()).ldelim(); } if (message.assistWith !== undefined) { writer.uint32(1120).int32(message.assistWith); } if (message.remoteDiscoveryEnabled !== undefined) { writer.uint32(1200).bool(message.remoteDiscoveryEnabled); } if (message.externalDeviceCount !== undefined) { writer.uint32(1208).uint32(message.externalDeviceCount); } if (message.externalDeviceVersion !== undefined) { ExternalDeviceVersion.encode(message.externalDeviceVersion, writer.uint32(1218).fork()).ldelim(); } if (message.bleRemoteSupported !== undefined) { writer.uint32(1224).bool(message.bleRemoteSupported); } if (message.debugInfo !== undefined) { DebugInfo.encode(message.debugInfo, writer.uint32(1250).fork()).ldelim(); } if (message.groupContainer !== undefined) { GroupContainer.encode(message.groupContainer, writer.uint32(1370).fork()).ldelim(); } if (message.uvcEnabled !== undefined) { writer.uint32(1376).bool(message.uvcEnabled); } if (message.uvcLife !== undefined) { writer.uint32(1384).uint32(message.uvcLife); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Property { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProperty(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.name = reader.string(); continue; case 2: if (tag !== 18) { break; } message.model = reader.string(); continue; case 4: if (tag !== 34) { break; } message.localTime = reader.string(); continue; case 5: if (tag !== 42) { break; } message.utcTime = reader.string(); continue; case 6: if (tag !== 50) { break; } message.timeZone = reader.string(); continue; case 7: if (tag !== 58) { break; } message.fwVersion = reader.string(); continue; case 8: if (tag !== 66) { break; } message.macAddress = reader.string(); continue; case 9: if (tag !== 74) { break; } message.cloudId = reader.string(); continue; case 10: if (tag !== 82) { break; } message.deviceId = reader.string(); continue; case 11: if (tag !== 90) { break; } message.cloudServerUrl = reader.string(); continue; case 13: if (tag !== 106) { break; } message.apiVersion = reader.string(); continue; case 15: if (tag !== 120) { break; } message.deviceTypeId = reader.uint32(); continue; case 16: if (tag !== 130) { break; } message.detailedVersion = DetailedVersion.decode(reader, reader.uint32()); continue; case 17: if (tag !== 138) { break; } message.deviceCapabilities = DeviceCapabilities.decode(reader, reader.uint32()); continue; case 37: if (tag !== 298) { break; } message.pcbaPartNumber = reader.string(); continue; case 38: if (tag !== 306) { break; } message.pcbaRevision = reader.string(); continue; case 43: if (tag !== 344) { break; } message.fanMode = reader.int32() as any; continue; case 44: if (tag !== 352) { break; } message.fanDirection = reader.int32() as any; continue; case 45: if (tag !== 360) { break; } message.fanPercent = reader.uint32(); continue; case 46: if (tag !== 368) { break; } message.fanSpeed = reader.uint32(); continue; case 47: if (tag !== 376) { break; } message.comfortSenseEnabled = reader.bool(); continue; case 48: if (tag !== 384) { break; } message.comfortSenseIdealTemp = reader.uint32(); continue; case 50: if (tag !== 400) { break; } message.comfortSenseMinSpeed = reader.uint32(); continue; case 51: if (tag !== 408) { break; } message.comfortSenseMaxSpeed = reader.uint32(); continue; case 52: if (tag !== 416) { break; } message.fanOccupancyEnabled = reader.bool(); continue; case 53: if (tag !== 424) { break; } message.fanOccupancyTimeout = reader.uint32(); continue; case 54: if (tag !== 432) { break; } message.fanReturnToAutoEnabled = reader.bool(); continue; case 55: if (tag !== 440) { break; } message.fanReturnToAutoTimeout = reader.uint32(); continue; case 58: if (tag !== 464) { break; } message.whooshEnabled = reader.bool(); continue; case 60: if (tag !== 480) { break; } message.comfortSenseHeatAssistEnabled = reader.bool(); continue; case 61: if (tag !== 488) { break; } message.comfortSenseHeatAssistSpeed = reader.uint32(); continue; case 62: if (tag !== 496) { break; } message.comfortSenseHeatAssistDirection = reader.int32() as any; continue; case 63: if (tag !== 504) { break; } message.commandedRpm = reader.uint32(); continue; case 64: if (tag !== 512) { break; } message.actualRpm = reader.uint32(); continue; case 65: if (tag !== 520) { break; } message.ecoModeEnabled = reader.bool(); continue; case 66: if (tag !== 528) { break; } message.fanOccupied = reader.bool(); continue; case 67: if (tag !== 536) { break; } message.fanOnMeansAuto = reader.bool(); continue; case 68: if (tag !== 544) { break; } message.lightMode = reader.int32() as any; continue; case 69: if (tag !== 552) { break; } message.lightPercent = reader.uint32(); continue; case 70: if (tag !== 560) { break; } message.lightLevel = reader.uint32(); continue; case 71: if (tag !== 568) { break; } message.lightColorTemperature = reader.uint32(); continue; case 72: if (tag !== 576) { break; } message.lightOccupancyEnabled = reader.bool(); continue; case 73: if (tag !== 584) { break; } message.lightOccupancyTimeout = reader.uint32(); continue; case 74: if (tag !== 592) { break; } message.lightReturnToAutoEnabled = reader.bool(); continue; case 75: if (tag !== 600) { break; } message.lightReturnToAutoTimeout = reader.uint32(); continue; case 77: if (tag !== 616) { break; } message.lightDimToWarmEnabled = reader.bool(); continue; case 78: if (tag !== 624) { break; } message.lightColorTemperatureMin = reader.uint32(); continue; case 79: if (tag !== 632) { break; } message.lightColorTemperatureMax = reader.uint32(); continue; case 82: if (tag !== 656) { break; } message.multipleLightMode = reader.int32() as any; continue; case 83: if (tag !== 666) { break; } message.standbyLed = StandbyLed.decode(reader, reader.uint32()); continue; case 85: if (tag !== 680) { break; } message.lightOccupied = reader.bool(); continue; case 86: if (tag !== 688) { break; } message.temperature = reader.uint32(); continue; case 87: if (tag !== 696) { break; } message.humidity = reader.uint32(); continue; case 95: if (tag !== 760) { break; } message.fanTimerMinutes = reader.uint32(); continue; case 96: if (tag !== 768) { break; } message.fanTimerUtcExpiration = longToNumber(reader.int64() as Long); continue; case 109: if (tag !== 872) { break; } message.lightOnMeansAuto = reader.bool(); continue; case 120: if (tag !== 962) { break; } message.ipAddress = reader.bytes(); continue; case 124: if (tag !== 994) { break; } message.network = Network.decode(reader, reader.uint32()); continue; case 134: if (tag !== 1072) { break; } message.indicatorsEnabled = reader.bool(); continue; case 135: if (tag !== 1080) { break; } message.audibleIndicatorEnabled = reader.bool(); continue; case 136: if (tag !== 1088) { break; } message.legacyIrEnabled = reader.bool(); continue; case 139: if (tag !== 1114) { break; } message.wallControlConfiguration = WallControlConfiguration.decode(reader, reader.uint32()); continue; case 140: if (tag !== 1120) { break; } message.assistWith = reader.int32() as any; continue; case 150: if (tag !== 1200) { break; } message.remoteDiscoveryEnabled = reader.bool(); continue; case 151: if (tag !== 1208) { break; } message.externalDeviceCount = reader.uint32(); continue; case 152: if (tag !== 1218) { break; } message.externalDeviceVersion = ExternalDeviceVersion.decode(reader, reader.uint32()); continue; case 153: if (tag !== 1224) { break; } message.bleRemoteSupported = reader.bool(); continue; case 156: if (tag !== 1250) { break; } message.debugInfo = DebugInfo.decode(reader, reader.uint32()); continue; case 171: if (tag !== 1370) { break; } message.groupContainer = GroupContainer.decode(reader, reader.uint32()); continue; case 172: if (tag !== 1376) { break; } message.uvcEnabled = reader.bool(); continue; case 173: if (tag !== 1384) { break; } message.uvcLife = reader.uint32(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): Property { return { name: isSet(object.name) ? globalThis.String(object.name) : undefined, model: isSet(object.model) ? globalThis.String(object.model) : undefined, localTime: isSet(object.localTime) ? globalThis.String(object.localTime) : undefined, utcTime: isSet(object.utcTime) ? globalThis.String(object.utcTime) : undefined, timeZone: isSet(object.timeZone) ? globalThis.String(object.timeZone) : undefined, fwVersion: isSet(object.fwVersion) ? globalThis.String(object.fwVersion) : undefined, macAddress: isSet(object.macAddress) ? globalThis.String(object.macAddress) : undefined, cloudId: isSet(object.cloudId) ? globalThis.String(object.cloudId) : undefined, deviceId: isSet(object.deviceId) ? globalThis.String(object.deviceId) : undefined, cloudServerUrl: isSet(object.cloudServerUrl) ? globalThis.String(object.cloudServerUrl) : undefined, apiVersion: isSet(object.apiVersion) ? globalThis.String(object.apiVersion) : undefined, deviceTypeId: isSet(object.deviceTypeId) ? globalThis.Number(object.deviceTypeId) : undefined, detailedVersion: isSet(object.detailedVersion) ? DetailedVersion.fromJSON(object.detailedVersion) : undefined, deviceCapabilities: isSet(object.deviceCapabilities) ? DeviceCapabilities.fromJSON(object.deviceCapabilities) : undefined, pcbaPartNumber: isSet(object.pcbaPartNumber) ? globalThis.String(object.pcbaPartNumber) : undefined, pcbaRevision: isSet(object.pcbaRevision) ? globalThis.String(object.pcbaRevision) : undefined, fanMode: isSet(object.fanMode) ? operatingModeFromJSON(object.fanMode) : undefined, fanDirection: isSet(object.fanDirection) ? directionFromJSON(object.fanDirection) : undefined, fanPercent: isSet(object.fanPercent) ? globalThis.Number(object.fanPercent) : undefined, fanSpeed: isSet(object.fanSpeed) ? globalThis.Number(object.fanSpeed) : undefined, comfortSenseEnabled: isSet(object.comfortSenseEnabled) ? globalThis.Boolean(object.comfortSenseEnabled) : undefined, comfortSenseIdealTemp: isSet(object.comfortSenseIdealTemp) ? globalThis.Number(object.comfortSenseIdealTemp) : undefined, comfortSenseMinSpeed: isSet(object.comfortSenseMinSpeed) ? globalThis.Number(object.comfortSenseMinSpeed) : undefined, comfortSenseMaxSpeed: isSet(object.comfortSenseMaxSpeed) ? globalThis.Number(object.comfortSenseMaxSpeed) : undefined, fanOccupancyEnabled: isSet(object.fanOccupancyEnabled) ? globalThis.Boolean(object.fanOccupancyEnabled) : undefined, fanOccupancyTimeout: isSet(object.fanOccupancyTimeout) ? globalThis.Number(object.fanOccupancyTimeout) : undefined, fanReturnToAutoEnabled: isSet(object.fanReturnToAutoEnabled) ? globalThis.Boolean(object.fanReturnToAutoEnabled) : undefined, fanReturnToAutoTimeout: isSet(object.fanReturnToAutoTimeout) ? globalThis.Number(object.fanReturnToAutoTimeout) : undefined, whooshEnabled: isSet(object.whooshEnabled) ? globalThis.Boolean(object.whooshEnabled) : undefined, comfortSenseHeatAssistEnabled: isSet(object.comfortSenseHeatAssistEnabled) ? globalThis.Boolean(object.comfortSenseHeatAssistEnabled) : undefined, comfortSenseHeatAssistSpeed: isSet(object.comfortSenseHeatAssistSpeed) ? globalThis.Number(object.comfortSenseHeatAssistSpeed) : undefined, comfortSenseHeatAssistDirection: isSet(object.comfortSenseHeatAssistDirection) ? directionFromJSON(object.comfortSenseHeatAssistDirection) : undefined, commandedRpm: isSet(object.commandedRpm) ? globalThis.Number(object.commandedRpm) : undefined, actualRpm: isSet(object.actualRpm) ? globalThis.Number(object.actualRpm) : undefined, ecoModeEnabled: isSet(object.ecoModeEnabled) ? globalThis.Boolean(object.ecoModeEnabled) : undefined, fanOccupied: isSet(object.fanOccupied) ? globalThis.Boolean(object.fanOccupied) : undefined, fanOnMeansAuto: isSet(object.fanOnMeansAuto) ? globalThis.Boolean(object.fanOnMeansAuto) : undefined, lightMode: isSet(object.lightMode) ? operatingModeFromJSON(object.lightMode) : undefined, lightPercent: isSet(object.lightPercent) ? globalThis.Number(object.lightPercent) : undefined, lightLevel: isSet(object.lightLevel) ? globalThis.Number(object.lightLevel) : undefined, lightColorTemperature: isSet(object.lightColorTemperature) ? globalThis.Number(object.lightColorTemperature) : undefined, lightOccupancyEnabled: isSet(object.lightOccupancyEnabled) ? globalThis.Boolean(object.lightOccupancyEnabled) : undefined, lightOccupancyTimeout: isSet(object.lightOccupancyTimeout) ? globalThis.Number(object.lightOccupancyTimeout) : undefined, lightReturnToAutoEnabled: isSet(object.lightReturnToAutoEnabled) ? globalThis.Boolean(object.lightReturnToAutoEnabled) : undefined, lightReturnToAutoTimeout: isSet(object.lightReturnToAutoTimeout) ? globalThis.Number(object.lightReturnToAutoTimeout) : undefined, lightDimToWarmEnabled: isSet(object.lightDimToWarmEnabled) ? globalThis.Boolean(object.lightDimToWarmEnabled) : undefined, lightColorTemperatureMin: isSet(object.lightColorTemperatureMin) ? globalThis.Number(object.lightColorTemperatureMin) : undefined, lightColorTemperatureMax: isSet(object.lightColorTemperatureMax) ? globalThis.Number(object.lightColorTemperatureMax) : undefined, multipleLightMode: isSet(object.multipleLightMode) ? multipleLightModeFromJSON(object.multipleLightMode) : undefined, standbyLed: isSet(object.standbyLed) ? StandbyLed.fromJSON(object.standbyLed) : undefined, lightOccupied: isSet(object.lightOccupied) ? globalThis.Boolean(object.lightOccupied) : undefined, temperature: isSet(object.temperature) ? globalThis.Number(object.temperature) : undefined, humidity: isSet(object.humidity) ? globalThis.Number(object.humidity) : undefined, fanTimerMinutes: isSet(object.fanTimerMinutes) ? globalThis.Number(object.fanTimerMinutes) : undefined, fanTimerUtcExpiration: isSet(object.fanTimerUtcExpiration) ? globalThis.Number(object.fanTimerUtcExpiration) : undefined, lightOnMeansAuto: isSet(object.lightOnMeansAuto) ? globalThis.Boolean(object.lightOnMeansAuto) : undefined, ipAddress: isSet(object.ipAddress) ? bytesFromBase64(object.ipAddress) : undefined, network: isSet(object.network) ? Network.fromJSON(object.network) : undefined, indicatorsEnabled: isSet(object.indicatorsEnabled) ? globalThis.Boolean(object.indicatorsEnabled) : undefined, audibleIndicatorEnabled: isSet(object.audibleIndicatorEnabled) ? globalThis.Boolean(object.audibleIndicatorEnabled) : undefined, legacyIrEnabled: isSet(object.legacyIrEnabled) ? globalThis.Boolean(object.legacyIrEnabled) : undefined, wallControlConfiguration: isSet(object.wallControlConfiguration) ? WallControlConfiguration.fromJSON(object.wallControlConfiguration) : undefined, assistWith: isSet(object.assistWith) ? assistWithFromJSON(object.assistWith) : undefined, remoteDiscoveryEnabled: isSet(object.remoteDiscoveryEnabled) ? globalThis.Boolean(object.remoteDiscoveryEnabled) : undefined, externalDeviceCount: isSet(object.externalDeviceCount) ? globalThis.Number(object.externalDeviceCount) : undefined, externalDeviceVersion: isSet(object.externalDeviceVersion) ? ExternalDeviceVersion.fromJSON(object.externalDeviceVersion) : undefined, bleRemoteSupported: isSet(object.bleRemoteSupported) ? globalThis.Boolean(object.bleRemoteSupported) : undefined, debugInfo: isSet(object.debugInfo) ? DebugInfo.fromJSON(object.debugInfo) : undefined, groupContainer: isSet(object.groupContainer) ? GroupContainer.fromJSON(object.groupContainer) : undefined, uvcEnabled: isSet(object.uvcEnabled) ? globalThis.Boolean(object.uvcEnabled) : undefined, uvcLife: isSet(object.uvcLife) ? globalThis.Number(object.uvcLife) : undefined, }; }, toJSON(message: Property): unknown { const obj: any = {}; if (message.name !== undefined) { obj.name = message.name; } if (message.model !== undefined) { obj.model = message.model; } if (message.localTime !== undefined) { obj.localTime = message.localTime; } if (message.utcTime !== undefined) { obj.utcTime = message.utcTime; } if (message.timeZone !== undefined) { obj.timeZone = message.timeZone; } if (message.fwVersion !== undefined) { obj.fwVersion = message.fwVersion; } if (message.macAddress !== undefined) { obj.macAddress = message.macAddress; } if (message.cloudId !== undefined) { obj.cloudId = message.cloudId; } if (message.deviceId !== undefined) { obj.deviceId = message.deviceId; } if (message.cloudServerUrl !== undefined) { obj.cloudServerUrl = message.cloudServerUrl; } if (message.apiVersion !== undefined) { obj.apiVersion = message.apiVersion; } if (message.deviceTypeId !== undefined) { obj.deviceTypeId = Math.round(message.deviceTypeId); } if (message.detailedVersion !== undefined) { obj.detailedVersion = DetailedVersion.toJSON(message.detailedVersion); } if (message.deviceCapabilities !== undefined) { obj.deviceCapabilities = DeviceCapabilities.toJSON(message.deviceCapabilities); } if (message.pcbaPartNumber !== undefined) { obj.pcbaPartNumber = message.pcbaPartNumber; } if (message.pcbaRevision !== undefined) { obj.pcbaRevision = message.pcbaRevision; } if (message.fanMode !== undefined) { obj.fanMode = operatingModeToJSON(message.fanMode); } if (message.fanDirection !== undefined) { obj.fanDirection = directionToJSON(message.fanDirection); } if (message.fanPercent !== undefined) { obj.fanPercent = Math.round(message.fanPercent); } if (message.fanSpeed !== undefined) { obj.fanSpeed = Math.round(message.fanSpeed); } if (message.comfortSenseEnabled !== undefined) { obj.comfortSenseEnabled = message.comfortSenseEnabled; } if (message.comfortSenseIdealTemp !== undefined) { obj.comfortSenseIdealTemp = Math.round(message.comfortSenseIdealTemp); } if (message.comfortSenseMinSpeed !== undefined) { obj.comfortSenseMinSpeed = Math.round(message.comfortSenseMinSpeed); } if (message.comfortSenseMaxSpeed !== undefined) { obj.comfortSenseMaxSpeed = Math.round(message.comfortSenseMaxSpeed); } if (message.fanOccupancyEnabled !== undefined) { obj.fanOccupancyEnabled = message.fanOccupancyEnabled; } if (message.fanOccupancyTimeout !== undefined) { obj.fanOccupancyTimeout = Math.round(message.fanOccupancyTimeout); } if (message.fanReturnToAutoEnabled !== undefined) { obj.fanReturnToAutoEnabled = message.fanReturnToAutoEnabled; } if (message.fanReturnToAutoTimeout !== undefined) { obj.fanReturnToAutoTimeout = Math.round(message.fanReturnToAutoTimeout); } if (message.whooshEnabled !== undefined) { obj.whooshEnabled = message.whooshEnabled; } if (message.comfortSenseHeatAssistEnabled !== undefined) { obj.comfortSenseHeatAssistEnabled = message.comfortSenseHeatAssistEnabled; } if (message.comfortSenseHeatAssistSpeed !== undefined) { obj.comfortSenseHeatAssistSpeed = Math.round(message.comfortSenseHeatAssistSpeed); } if (message.comfortSenseHeatAssistDirection !== undefined) { obj.comfortSenseHeatAssistDirection = directionToJSON(message.comfortSenseHeatAssistDirection); } if (message.commandedRpm !== undefined) { obj.commandedRpm = Math.round(message.commandedRpm); } if (message.actualRpm !== undefined) { obj.actualRpm = Math.round(message.actualRpm); } if (message.ecoModeEnabled !== undefined) { obj.ecoModeEnabled = message.ecoModeEnabled; } if (message.fanOccupied !== undefined) { obj.fanOccupied = message.fanOccupied; } if (message.fanOnMeansAuto !== undefined) { obj.fanOnMeansAuto = message.fanOnMeansAuto; } if (message.lightMode !== undefined) { obj.lightMode = operatingModeToJSON(message.lightMode); } if (message.lightPercent !== undefined) { obj.lightPercent = Math.round(message.lightPercent); } if (message.lightLevel !== undefined) { obj.lightLevel = Math.round(message.lightLevel); } if (message.lightColorTemperature !== undefined) { obj.lightColorTemperature = Math.round(message.lightColorTemperature); } if (message.lightOccupancyEnabled !== undefined) { obj.lightOccupancyEnabled = message.lightOccupancyEnabled; } if (message.lightOccupancyTimeout !== undefined) { obj.lightOccupancyTimeout = Math.round(message.lightOccupancyTimeout); } if (message.lightReturnToAutoEnabled !== undefined) { obj.lightReturnToAutoEnabled = message.lightReturnToAutoEnabled; } if (message.lightReturnToAutoTimeout !== undefined) { obj.lightReturnToAutoTimeout = Math.round(message.lightReturnToAutoTimeout); } if (message.lightDimToWarmEnabled !== undefined) { obj.lightDimToWarmEnabled = message.lightDimToWarmEnabled; } if (message.lightColorTemperatureMin !== undefined) { obj.lightColorTemperatureMin = Math.round(message.lightColorTemperatureMin); } if (message.lightColorTemperatureMax !== undefined) { obj.lightColorTemperatureMax = Math.round(message.lightColorTemperatureMax); } if (message.multipleLightMode !== undefined) { obj.multipleLightMode = multipleLightModeToJSON(message.multipleLightMode); } if (message.standbyLed !== undefined) { obj.standbyLed = StandbyLed.toJSON(message.standbyLed); } if (message.lightOccupied !== undefined) { obj.lightOccupied = message.lightOccupied; } if (message.temperature !== undefined) { obj.temperature = Math.round(message.temperature); } if (message.humidity !== undefined) { obj.humidity = Math.round(message.humidity); } if (message.fanTimerMinutes !== undefined) { obj.fanTimerMinutes = Math.round(message.fanTimerMinutes); } if (message.fanTimerUtcExpiration !== undefined) { obj.fanTimerUtcExpiration = Math.round(message.fanTimerUtcExpiration); } if (message.lightOnMeansAuto !== undefined) { obj.lightOnMeansAuto = message.lightOnMeansAuto; } if (message.ipAddress !== undefined) { obj.ipAddress = base64FromBytes(message.ipAddress); } if (message.network !== undefined) { obj.network = Network.toJSON(message.network); } if (message.indicatorsEnabled !== undefined) { obj.indicatorsEnabled = message.indicatorsEnabled; } if (message.audibleIndicatorEnabled !== undefined) { obj.audibleIndicatorEnabled = message.audibleIndicatorEnabled; } if (message.legacyIrEnabled !== undefined) { obj.legacyIrEnabled = message.legacyIrEnabled; } if (message.wallControlConfiguration !== undefined) { obj.wallControlConfiguration = WallControlConfiguration.toJSON(message.wallControlConfiguration); } if (message.assistWith !== undefined) { obj.assistWith = assistWithToJSON(message.assistWith); } if (message.remoteDiscoveryEnabled !== undefined) { obj.remoteDiscoveryEnabled = message.remoteDiscoveryEnabled; } if (message.externalDeviceCount !== undefined) { obj.externalDeviceCount = Math.round(message.externalDeviceCount); } if (message.externalDeviceVersion !== undefined) { obj.externalDeviceVersion = ExternalDeviceVersion.toJSON(message.externalDeviceVersion); } if (message.bleRemoteSupported !== undefined) { obj.bleRemoteSupported = message.bleRemoteSupported; } if (message.debugInfo !== undefined) { obj.debugInfo = DebugInfo.toJSON(message.debugInfo); } if (message.groupContainer !== undefined) { obj.groupContainer = GroupContainer.toJSON(message.groupContainer); } if (message.uvcEnabled !== undefined) { obj.uvcEnabled = message.uvcEnabled; } if (message.uvcLife !== undefined) { obj.uvcLife = Math.round(message.uvcLife); } return obj; }, create, I>>(base?: I): Property { return Property.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): Property { const message = createBaseProperty(); message.name = object.name ?? undefined; message.model = object.model ?? undefined; message.localTime = object.localTime ?? undefined; message.utcTime = object.utcTime ?? undefined; message.timeZone = object.timeZone ?? undefined; message.fwVersion = object.fwVersion ?? undefined; message.macAddress = object.macAddress ?? undefined; message.cloudId = object.cloudId ?? undefined; message.deviceId = object.deviceId ?? undefined; message.cloudServerUrl = object.cloudServerUrl ?? undefined; message.apiVersion = object.apiVersion ?? undefined; message.deviceTypeId = object.deviceTypeId ?? undefined; message.detailedVersion = (object.detailedVersion !== undefined && object.detailedVersion !== null) ? DetailedVersion.fromPartial(object.detailedVersion) : undefined; message.deviceCapabilities = (object.deviceCapabilities !== undefined && object.deviceCapabilities !== null) ? DeviceCapabilities.fromPartial(object.deviceCapabilities) : undefined; message.pcbaPartNumber = object.pcbaPartNumber ?? undefined; message.pcbaRevision = object.pcbaRevision ?? undefined; message.fanMode = object.fanMode ?? undefined; message.fanDirection = object.fanDirection ?? undefined; message.fanPercent = object.fanPercent ?? undefined; message.fanSpeed = object.fanSpeed ?? undefined; message.comfortSenseEnabled = object.comfortSenseEnabled ?? undefined; message.comfortSenseIdealTemp = object.comfortSenseIdealTemp ?? undefined; message.comfortSenseMinSpeed = object.comfortSenseMinSpeed ?? undefined; message.comfortSenseMaxSpeed = object.comfortSenseMaxSpeed ?? undefined; message.fanOccupancyEnabled = object.fanOccupancyEnabled ?? undefined; message.fanOccupancyTimeout = object.fanOccupancyTimeout ?? undefined; message.fanReturnToAutoEnabled = object.fanReturnToAutoEnabled ?? undefined; message.fanReturnToAutoTimeout = object.fanReturnToAutoTimeout ?? undefined; message.whooshEnabled = object.whooshEnabled ?? undefined; message.comfortSenseHeatAssistEnabled = object.comfortSenseHeatAssistEnabled ?? undefined; message.comfortSenseHeatAssistSpeed = object.comfortSenseHeatAssistSpeed ?? undefined; message.comfortSenseHeatAssistDirection = object.comfortSenseHeatAssistDirection ?? undefined; message.commandedRpm = object.commandedRpm ?? undefined; message.actualRpm = object.actualRpm ?? undefined; message.ecoModeEnabled = object.ecoModeEnabled ?? undefined; message.fanOccupied = object.fanOccupied ?? undefined; message.fanOnMeansAuto = object.fanOnMeansAuto ?? undefined; message.lightMode = object.lightMode ?? undefined; message.lightPercent = object.lightPercent ?? undefined; message.lightLevel = object.lightLevel ?? undefined; message.lightColorTemperature = object.lightColorTemperature ?? undefined; message.lightOccupancyEnabled = object.lightOccupancyEnabled ?? undefined; message.lightOccupancyTimeout = object.lightOccupancyTimeout ?? undefined; message.lightReturnToAutoEnabled = object.lightReturnToAutoEnabled ?? undefined; message.lightReturnToAutoTimeout = object.lightReturnToAutoTimeout ?? undefined; message.lightDimToWarmEnabled = object.lightDimToWarmEnabled ?? undefined; message.lightColorTemperatureMin = object.lightColorTemperatureMin ?? undefined; message.lightColorTemperatureMax = object.lightColorTemperatureMax ?? undefined; message.multipleLightMode = object.multipleLightMode ?? undefined; message.standbyLed = (object.standbyLed !== undefined && object.standbyLed !== null) ? StandbyLed.fromPartial(object.standbyLed) : undefined; message.lightOccupied = object.lightOccupied ?? undefined; message.temperature = object.temperature ?? undefined; message.humidity = object.humidity ?? undefined; message.fanTimerMinutes = object.fanTimerMinutes ?? undefined; message.fanTimerUtcExpiration = object.fanTimerUtcExpiration ?? undefined; message.lightOnMeansAuto = object.lightOnMeansAuto ?? undefined; message.ipAddress = object.ipAddress ?? undefined; message.network = (object.network !== undefined && object.network !== null) ? Network.fromPartial(object.network) : undefined; message.indicatorsEnabled = object.indicatorsEnabled ?? undefined; message.audibleIndicatorEnabled = object.audibleIndicatorEnabled ?? undefined; message.legacyIrEnabled = object.legacyIrEnabled ?? undefined; message.wallControlConfiguration = (object.wallControlConfiguration !== undefined && object.wallControlConfiguration !== null) ? WallControlConfiguration.fromPartial(object.wallControlConfiguration) : undefined; message.assistWith = object.assistWith ?? undefined; message.remoteDiscoveryEnabled = object.remoteDiscoveryEnabled ?? undefined; message.externalDeviceCount = object.externalDeviceCount ?? undefined; message.externalDeviceVersion = (object.externalDeviceVersion !== undefined && object.externalDeviceVersion !== null) ? ExternalDeviceVersion.fromPartial(object.externalDeviceVersion) : undefined; message.bleRemoteSupported = object.bleRemoteSupported ?? undefined; message.debugInfo = (object.debugInfo !== undefined && object.debugInfo !== null) ? DebugInfo.fromPartial(object.debugInfo) : undefined; message.groupContainer = (object.groupContainer !== undefined && object.groupContainer !== null) ? GroupContainer.fromPartial(object.groupContainer) : undefined; message.uvcEnabled = object.uvcEnabled ?? undefined; message.uvcLife = object.uvcLife ?? undefined; return message; }, }; function createBaseNetwork(): Network { return { ssid: new Uint8Array(0) }; } export const Network = { encode(message: Network, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.ssid.length !== 0) { writer.uint32(10).bytes(message.ssid); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Network { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseNetwork(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.ssid = reader.bytes(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): Network { return { ssid: isSet(object.ssid) ? bytesFromBase64(object.ssid) : new Uint8Array(0) }; }, toJSON(message: Network): unknown { const obj: any = {}; if (message.ssid.length !== 0) { obj.ssid = base64FromBytes(message.ssid); } return obj; }, create, I>>(base?: I): Network { return Network.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): Network { const message = createBaseNetwork(); message.ssid = object.ssid ?? new Uint8Array(0); return message; }, }; function createBaseWallControlConfiguration(): WallControlConfiguration { return { topButtonFunction: 0, bottomButtonFunction: 0 }; } export const WallControlConfiguration = { encode(message: WallControlConfiguration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.topButtonFunction !== 0) { writer.uint32(8).int32(message.topButtonFunction); } if (message.bottomButtonFunction !== 0) { writer.uint32(16).int32(message.bottomButtonFunction); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): WallControlConfiguration { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseWallControlConfiguration(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.topButtonFunction = reader.int32() as any; continue; case 2: if (tag !== 16) { break; } message.bottomButtonFunction = reader.int32() as any; continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): WallControlConfiguration { return { topButtonFunction: isSet(object.topButtonFunction) ? wallControlConfiguration_FunctionFromJSON(object.topButtonFunction) : 0, bottomButtonFunction: isSet(object.bottomButtonFunction) ? wallControlConfiguration_FunctionFromJSON(object.bottomButtonFunction) : 0, }; }, toJSON(message: WallControlConfiguration): unknown { const obj: any = {}; if (message.topButtonFunction !== 0) { obj.topButtonFunction = wallControlConfiguration_FunctionToJSON(message.topButtonFunction); } if (message.bottomButtonFunction !== 0) { obj.bottomButtonFunction = wallControlConfiguration_FunctionToJSON(message.bottomButtonFunction); } return obj; }, create, I>>(base?: I): WallControlConfiguration { return WallControlConfiguration.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): WallControlConfiguration { const message = createBaseWallControlConfiguration(); message.topButtonFunction = object.topButtonFunction ?? 0; message.bottomButtonFunction = object.bottomButtonFunction ?? 0; return message; }, }; function createBaseDebugInfo(): DebugInfo { return { uptimeMinutes: 0, rebootCountTotal: 0, rebootCountSincePor: 0, lastRebootReason: 0, lastRebootDetails: 0, softwareError: 0, softwareErrorDetails: 0, }; } export const DebugInfo = { encode(message: DebugInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.uptimeMinutes !== 0) { writer.uint32(8).uint32(message.uptimeMinutes); } if (message.rebootCountTotal !== 0) { writer.uint32(16).uint32(message.rebootCountTotal); } if (message.rebootCountSincePor !== 0) { writer.uint32(24).uint32(message.rebootCountSincePor); } if (message.lastRebootReason !== 0) { writer.uint32(32).int32(message.lastRebootReason); } if (message.lastRebootDetails !== 0) { writer.uint32(40).uint32(message.lastRebootDetails); } if (message.softwareError !== 0) { writer.uint32(48).uint32(message.softwareError); } if (message.softwareErrorDetails !== 0) { writer.uint32(56).uint32(message.softwareErrorDetails); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): DebugInfo { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDebugInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.uptimeMinutes = reader.uint32(); continue; case 2: if (tag !== 16) { break; } message.rebootCountTotal = reader.uint32(); continue; case 3: if (tag !== 24) { break; } message.rebootCountSincePor = reader.uint32(); continue; case 4: if (tag !== 32) { break; } message.lastRebootReason = reader.int32() as any; continue; case 5: if (tag !== 40) { break; } message.lastRebootDetails = reader.uint32(); continue; case 6: if (tag !== 48) { break; } message.softwareError = reader.uint32(); continue; case 7: if (tag !== 56) { break; } message.softwareErrorDetails = reader.uint32(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): DebugInfo { return { uptimeMinutes: isSet(object.uptimeMinutes) ? globalThis.Number(object.uptimeMinutes) : 0, rebootCountTotal: isSet(object.rebootCountTotal) ? globalThis.Number(object.rebootCountTotal) : 0, rebootCountSincePor: isSet(object.rebootCountSincePor) ? globalThis.Number(object.rebootCountSincePor) : 0, lastRebootReason: isSet(object.lastRebootReason) ? rebootReasonFromJSON(object.lastRebootReason) : 0, lastRebootDetails: isSet(object.lastRebootDetails) ? globalThis.Number(object.lastRebootDetails) : 0, softwareError: isSet(object.softwareError) ? globalThis.Number(object.softwareError) : 0, softwareErrorDetails: isSet(object.softwareErrorDetails) ? globalThis.Number(object.softwareErrorDetails) : 0, }; }, toJSON(message: DebugInfo): unknown { const obj: any = {}; if (message.uptimeMinutes !== 0) { obj.uptimeMinutes = Math.round(message.uptimeMinutes); } if (message.rebootCountTotal !== 0) { obj.rebootCountTotal = Math.round(message.rebootCountTotal); } if (message.rebootCountSincePor !== 0) { obj.rebootCountSincePor = Math.round(message.rebootCountSincePor); } if (message.lastRebootReason !== 0) { obj.lastRebootReason = rebootReasonToJSON(message.lastRebootReason); } if (message.lastRebootDetails !== 0) { obj.lastRebootDetails = Math.round(message.lastRebootDetails); } if (message.softwareError !== 0) { obj.softwareError = Math.round(message.softwareError); } if (message.softwareErrorDetails !== 0) { obj.softwareErrorDetails = Math.round(message.softwareErrorDetails); } return obj; }, create, I>>(base?: I): DebugInfo { return DebugInfo.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): DebugInfo { const message = createBaseDebugInfo(); message.uptimeMinutes = object.uptimeMinutes ?? 0; message.rebootCountTotal = object.rebootCountTotal ?? 0; message.rebootCountSincePor = object.rebootCountSincePor ?? 0; message.lastRebootReason = object.lastRebootReason ?? 0; message.lastRebootDetails = object.lastRebootDetails ?? 0; message.softwareError = object.softwareError ?? 0; message.softwareErrorDetails = object.softwareErrorDetails ?? 0; return message; }, }; function createBaseDetailedVersion(): DetailedVersion { return { type: 0, appVersion: "", bootloaderVersion: "" }; } export const DetailedVersion = { encode(message: DetailedVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { writer.uint32(8).int32(message.type); } if (message.appVersion !== "") { writer.uint32(18).string(message.appVersion); } if (message.bootloaderVersion !== "") { writer.uint32(26).string(message.bootloaderVersion); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): DetailedVersion { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDetailedVersion(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.type = reader.int32() as any; continue; case 2: if (tag !== 18) { break; } message.appVersion = reader.string(); continue; case 3: if (tag !== 26) { break; } message.bootloaderVersion = reader.string(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): DetailedVersion { return { type: isSet(object.type) ? firmwareTypeFromJSON(object.type) : 0, appVersion: isSet(object.appVersion) ? globalThis.String(object.appVersion) : "", bootloaderVersion: isSet(object.bootloaderVersion) ? globalThis.String(object.bootloaderVersion) : "", }; }, toJSON(message: DetailedVersion): unknown { const obj: any = {}; if (message.type !== 0) { obj.type = firmwareTypeToJSON(message.type); } if (message.appVersion !== "") { obj.appVersion = message.appVersion; } if (message.bootloaderVersion !== "") { obj.bootloaderVersion = message.bootloaderVersion; } return obj; }, create, I>>(base?: I): DetailedVersion { return DetailedVersion.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): DetailedVersion { const message = createBaseDetailedVersion(); message.type = object.type ?? 0; message.appVersion = object.appVersion ?? ""; message.bootloaderVersion = object.bootloaderVersion ?? ""; return message; }, }; function createBaseExternalDeviceVersion(): ExternalDeviceVersion { return { type: 0, packageVersion: "", bootloaderVersion: "", macAddress: "", rebootReason: 0 }; } export const ExternalDeviceVersion = { encode(message: ExternalDeviceVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.type !== 0) { writer.uint32(8).int32(message.type); } if (message.packageVersion !== "") { writer.uint32(18).string(message.packageVersion); } if (message.bootloaderVersion !== "") { writer.uint32(26).string(message.bootloaderVersion); } if (message.macAddress !== "") { writer.uint32(34).string(message.macAddress); } if (message.rebootReason !== 0) { writer.uint32(56).int32(message.rebootReason); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ExternalDeviceVersion { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExternalDeviceVersion(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.type = reader.int32() as any; continue; case 2: if (tag !== 18) { break; } message.packageVersion = reader.string(); continue; case 3: if (tag !== 26) { break; } message.bootloaderVersion = reader.string(); continue; case 4: if (tag !== 34) { break; } message.macAddress = reader.string(); continue; case 7: if (tag !== 56) { break; } message.rebootReason = reader.int32() as any; continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): ExternalDeviceVersion { return { type: isSet(object.type) ? externalDeviceTypeFromJSON(object.type) : 0, packageVersion: isSet(object.packageVersion) ? globalThis.String(object.packageVersion) : "", bootloaderVersion: isSet(object.bootloaderVersion) ? globalThis.String(object.bootloaderVersion) : "", macAddress: isSet(object.macAddress) ? globalThis.String(object.macAddress) : "", rebootReason: isSet(object.rebootReason) ? rebootReasonFromJSON(object.rebootReason) : 0, }; }, toJSON(message: ExternalDeviceVersion): unknown { const obj: any = {}; if (message.type !== 0) { obj.type = externalDeviceTypeToJSON(message.type); } if (message.packageVersion !== "") { obj.packageVersion = message.packageVersion; } if (message.bootloaderVersion !== "") { obj.bootloaderVersion = message.bootloaderVersion; } if (message.macAddress !== "") { obj.macAddress = message.macAddress; } if (message.rebootReason !== 0) { obj.rebootReason = rebootReasonToJSON(message.rebootReason); } return obj; }, create, I>>(base?: I): ExternalDeviceVersion { return ExternalDeviceVersion.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): ExternalDeviceVersion { const message = createBaseExternalDeviceVersion(); message.type = object.type ?? 0; message.packageVersion = object.packageVersion ?? ""; message.bootloaderVersion = object.bootloaderVersion ?? ""; message.macAddress = object.macAddress ?? ""; message.rebootReason = object.rebootReason ?? 0; return message; }, }; function createBaseGroupContainer(): GroupContainer { return { uuid: new Uint8Array(0), name: "" }; } export const GroupContainer = { encode(message: GroupContainer, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.uuid.length !== 0) { writer.uint32(18).bytes(message.uuid); } if (message.name !== "") { writer.uint32(26).string(message.name); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): GroupContainer { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGroupContainer(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: if (tag !== 18) { break; } message.uuid = reader.bytes(); continue; case 3: if (tag !== 26) { break; } message.name = reader.string(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): GroupContainer { return { uuid: isSet(object.uuid) ? bytesFromBase64(object.uuid) : new Uint8Array(0), name: isSet(object.name) ? globalThis.String(object.name) : "", }; }, toJSON(message: GroupContainer): unknown { const obj: any = {}; if (message.uuid.length !== 0) { obj.uuid = base64FromBytes(message.uuid); } if (message.name !== "") { obj.name = message.name; } return obj; }, create, I>>(base?: I): GroupContainer { return GroupContainer.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): GroupContainer { const message = createBaseGroupContainer(); message.uuid = object.uuid ?? new Uint8Array(0); message.name = object.name ?? ""; return message; }, }; function createBaseStandbyLed(): StandbyLed { return { colorPreset: 0, enabled: false, percent: 0, red: 0, green: 0, blue: 0 }; } export const StandbyLed = { encode(message: StandbyLed, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.colorPreset !== 0) { writer.uint32(8).int32(message.colorPreset); } if (message.enabled === true) { writer.uint32(16).bool(message.enabled); } if (message.percent !== 0) { writer.uint32(24).uint32(message.percent); } if (message.red !== 0) { writer.uint32(32).uint32(message.red); } if (message.green !== 0) { writer.uint32(40).uint32(message.green); } if (message.blue !== 0) { writer.uint32(48).uint32(message.blue); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): StandbyLed { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStandbyLed(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.colorPreset = reader.int32() as any; continue; case 2: if (tag !== 16) { break; } message.enabled = reader.bool(); continue; case 3: if (tag !== 24) { break; } message.percent = reader.uint32(); continue; case 4: if (tag !== 32) { break; } message.red = reader.uint32(); continue; case 5: if (tag !== 40) { break; } message.green = reader.uint32(); continue; case 6: if (tag !== 48) { break; } message.blue = reader.uint32(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): StandbyLed { return { colorPreset: isSet(object.colorPreset) ? standbyLed_ColorPresetFromJSON(object.colorPreset) : 0, enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false, percent: isSet(object.percent) ? globalThis.Number(object.percent) : 0, red: isSet(object.red) ? globalThis.Number(object.red) : 0, green: isSet(object.green) ? globalThis.Number(object.green) : 0, blue: isSet(object.blue) ? globalThis.Number(object.blue) : 0, }; }, toJSON(message: StandbyLed): unknown { const obj: any = {}; if (message.colorPreset !== 0) { obj.colorPreset = standbyLed_ColorPresetToJSON(message.colorPreset); } if (message.enabled === true) { obj.enabled = message.enabled; } if (message.percent !== 0) { obj.percent = Math.round(message.percent); } if (message.red !== 0) { obj.red = Math.round(message.red); } if (message.green !== 0) { obj.green = Math.round(message.green); } if (message.blue !== 0) { obj.blue = Math.round(message.blue); } return obj; }, create, I>>(base?: I): StandbyLed { return StandbyLed.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): StandbyLed { const message = createBaseStandbyLed(); message.colorPreset = object.colorPreset ?? 0; message.enabled = object.enabled ?? false; message.percent = object.percent ?? 0; message.red = object.red ?? 0; message.green = object.green ?? 0; message.blue = object.blue ?? 0; return message; }, }; function createBaseDeviceCapabilities(): DeviceCapabilities { return { hasTempSensor: false, hasHumiditySensor: false, hasOccupancySensor: false, hasLight: false, hasLightSensor: false, hasColorTempControl: false, hasFan: false, hasSpeaker: false, hasPiezo: false, hasLedIndicators: false, hasUplight: false, hasUvcLight: false, hasStandbyLed: false, hasEcoMode: false, }; } export const DeviceCapabilities = { encode(message: DeviceCapabilities, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.hasTempSensor === true) { writer.uint32(8).bool(message.hasTempSensor); } if (message.hasHumiditySensor === true) { writer.uint32(16).bool(message.hasHumiditySensor); } if (message.hasOccupancySensor === true) { writer.uint32(24).bool(message.hasOccupancySensor); } if (message.hasLight === true) { writer.uint32(32).bool(message.hasLight); } if (message.hasLightSensor === true) { writer.uint32(40).bool(message.hasLightSensor); } if (message.hasColorTempControl === true) { writer.uint32(48).bool(message.hasColorTempControl); } if (message.hasFan === true) { writer.uint32(56).bool(message.hasFan); } if (message.hasSpeaker === true) { writer.uint32(64).bool(message.hasSpeaker); } if (message.hasPiezo === true) { writer.uint32(72).bool(message.hasPiezo); } if (message.hasLedIndicators === true) { writer.uint32(80).bool(message.hasLedIndicators); } if (message.hasUplight === true) { writer.uint32(88).bool(message.hasUplight); } if (message.hasUvcLight === true) { writer.uint32(96).bool(message.hasUvcLight); } if (message.hasStandbyLed === true) { writer.uint32(104).bool(message.hasStandbyLed); } if (message.hasEcoMode === true) { writer.uint32(112).bool(message.hasEcoMode); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): DeviceCapabilities { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDeviceCapabilities(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.hasTempSensor = reader.bool(); continue; case 2: if (tag !== 16) { break; } message.hasHumiditySensor = reader.bool(); continue; case 3: if (tag !== 24) { break; } message.hasOccupancySensor = reader.bool(); continue; case 4: if (tag !== 32) { break; } message.hasLight = reader.bool(); continue; case 5: if (tag !== 40) { break; } message.hasLightSensor = reader.bool(); continue; case 6: if (tag !== 48) { break; } message.hasColorTempControl = reader.bool(); continue; case 7: if (tag !== 56) { break; } message.hasFan = reader.bool(); continue; case 8: if (tag !== 64) { break; } message.hasSpeaker = reader.bool(); continue; case 9: if (tag !== 72) { break; } message.hasPiezo = reader.bool(); continue; case 10: if (tag !== 80) { break; } message.hasLedIndicators = reader.bool(); continue; case 11: if (tag !== 88) { break; } message.hasUplight = reader.bool(); continue; case 12: if (tag !== 96) { break; } message.hasUvcLight = reader.bool(); continue; case 13: if (tag !== 104) { break; } message.hasStandbyLed = reader.bool(); continue; case 14: if (tag !== 112) { break; } message.hasEcoMode = reader.bool(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): DeviceCapabilities { return { hasTempSensor: isSet(object.hasTempSensor) ? globalThis.Boolean(object.hasTempSensor) : false, hasHumiditySensor: isSet(object.hasHumiditySensor) ? globalThis.Boolean(object.hasHumiditySensor) : false, hasOccupancySensor: isSet(object.hasOccupancySensor) ? globalThis.Boolean(object.hasOccupancySensor) : false, hasLight: isSet(object.hasLight) ? globalThis.Boolean(object.hasLight) : false, hasLightSensor: isSet(object.hasLightSensor) ? globalThis.Boolean(object.hasLightSensor) : false, hasColorTempControl: isSet(object.hasColorTempControl) ? globalThis.Boolean(object.hasColorTempControl) : false, hasFan: isSet(object.hasFan) ? globalThis.Boolean(object.hasFan) : false, hasSpeaker: isSet(object.hasSpeaker) ? globalThis.Boolean(object.hasSpeaker) : false, hasPiezo: isSet(object.hasPiezo) ? globalThis.Boolean(object.hasPiezo) : false, hasLedIndicators: isSet(object.hasLedIndicators) ? globalThis.Boolean(object.hasLedIndicators) : false, hasUplight: isSet(object.hasUplight) ? globalThis.Boolean(object.hasUplight) : false, hasUvcLight: isSet(object.hasUvcLight) ? globalThis.Boolean(object.hasUvcLight) : false, hasStandbyLed: isSet(object.hasStandbyLed) ? globalThis.Boolean(object.hasStandbyLed) : false, hasEcoMode: isSet(object.hasEcoMode) ? globalThis.Boolean(object.hasEcoMode) : false, }; }, toJSON(message: DeviceCapabilities): unknown { const obj: any = {}; if (message.hasTempSensor === true) { obj.hasTempSensor = message.hasTempSensor; } if (message.hasHumiditySensor === true) { obj.hasHumiditySensor = message.hasHumiditySensor; } if (message.hasOccupancySensor === true) { obj.hasOccupancySensor = message.hasOccupancySensor; } if (message.hasLight === true) { obj.hasLight = message.hasLight; } if (message.hasLightSensor === true) { obj.hasLightSensor = message.hasLightSensor; } if (message.hasColorTempControl === true) { obj.hasColorTempControl = message.hasColorTempControl; } if (message.hasFan === true) { obj.hasFan = message.hasFan; } if (message.hasSpeaker === true) { obj.hasSpeaker = message.hasSpeaker; } if (message.hasPiezo === true) { obj.hasPiezo = message.hasPiezo; } if (message.hasLedIndicators === true) { obj.hasLedIndicators = message.hasLedIndicators; } if (message.hasUplight === true) { obj.hasUplight = message.hasUplight; } if (message.hasUvcLight === true) { obj.hasUvcLight = message.hasUvcLight; } if (message.hasStandbyLed === true) { obj.hasStandbyLed = message.hasStandbyLed; } if (message.hasEcoMode === true) { obj.hasEcoMode = message.hasEcoMode; } return obj; }, create, I>>(base?: I): DeviceCapabilities { return DeviceCapabilities.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): DeviceCapabilities { const message = createBaseDeviceCapabilities(); message.hasTempSensor = object.hasTempSensor ?? false; message.hasHumiditySensor = object.hasHumiditySensor ?? false; message.hasOccupancySensor = object.hasOccupancySensor ?? false; message.hasLight = object.hasLight ?? false; message.hasLightSensor = object.hasLightSensor ?? false; message.hasColorTempControl = object.hasColorTempControl ?? false; message.hasFan = object.hasFan ?? false; message.hasSpeaker = object.hasSpeaker ?? false; message.hasPiezo = object.hasPiezo ?? false; message.hasLedIndicators = object.hasLedIndicators ?? false; message.hasUplight = object.hasUplight ?? false; message.hasUvcLight = object.hasUvcLight ?? false; message.hasStandbyLed = object.hasStandbyLed ?? false; message.hasEcoMode = object.hasEcoMode ?? false; return message; }, }; function createBaseScheduleProperty(): ScheduleProperty { return { fanMode: undefined, fanDirection: undefined, fanSpeed: undefined, fanPercent: undefined, lightMode: undefined, lightLevel: undefined, lightColorTemperature: undefined, lightPercent: undefined, uplightPercent: undefined, multipleLightMode: undefined, comfortSenseEnabled: undefined, comfortSenseIdealTemp: undefined, comfortSenseMinSpeed: undefined, comfortSenseMaxSpeed: undefined, fanOccupancyEnabled: undefined, fanOccupancyTimeout: undefined, lightOccupancyEnabled: undefined, lightOccupancyTimeout: undefined, }; } export const ScheduleProperty = { encode(message: ScheduleProperty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.fanMode !== undefined) { writer.uint32(8).int32(message.fanMode); } if (message.fanDirection !== undefined) { writer.uint32(16).int32(message.fanDirection); } if (message.fanSpeed !== undefined) { writer.uint32(32).uint32(message.fanSpeed); } if (message.fanPercent !== undefined) { writer.uint32(24).uint32(message.fanPercent); } if (message.lightMode !== undefined) { writer.uint32(40).int32(message.lightMode); } if (message.lightLevel !== undefined) { writer.uint32(56).uint32(message.lightLevel); } if (message.lightColorTemperature !== undefined) { writer.uint32(64).uint32(message.lightColorTemperature); } if (message.lightPercent !== undefined) { writer.uint32(48).uint32(message.lightPercent); } if (message.uplightPercent !== undefined) { writer.uint32(72).uint32(message.uplightPercent); } if (message.multipleLightMode !== undefined) { writer.uint32(80).int32(message.multipleLightMode); } if (message.comfortSenseEnabled !== undefined) { writer.uint32(88).bool(message.comfortSenseEnabled); } if (message.comfortSenseIdealTemp !== undefined) { writer.uint32(96).uint32(message.comfortSenseIdealTemp); } if (message.comfortSenseMinSpeed !== undefined) { writer.uint32(104).uint32(message.comfortSenseMinSpeed); } if (message.comfortSenseMaxSpeed !== undefined) { writer.uint32(112).uint32(message.comfortSenseMaxSpeed); } if (message.fanOccupancyEnabled !== undefined) { writer.uint32(120).bool(message.fanOccupancyEnabled); } if (message.fanOccupancyTimeout !== undefined) { writer.uint32(128).uint32(message.fanOccupancyTimeout); } if (message.lightOccupancyEnabled !== undefined) { writer.uint32(136).bool(message.lightOccupancyEnabled); } if (message.lightOccupancyTimeout !== undefined) { writer.uint32(144).uint32(message.lightOccupancyTimeout); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ScheduleProperty { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseScheduleProperty(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.fanMode = reader.int32() as any; continue; case 2: if (tag !== 16) { break; } message.fanDirection = reader.int32() as any; continue; case 4: if (tag !== 32) { break; } message.fanSpeed = reader.uint32(); continue; case 3: if (tag !== 24) { break; } message.fanPercent = reader.uint32(); continue; case 5: if (tag !== 40) { break; } message.lightMode = reader.int32() as any; continue; case 7: if (tag !== 56) { break; } message.lightLevel = reader.uint32(); continue; case 8: if (tag !== 64) { break; } message.lightColorTemperature = reader.uint32(); continue; case 6: if (tag !== 48) { break; } message.lightPercent = reader.uint32(); continue; case 9: if (tag !== 72) { break; } message.uplightPercent = reader.uint32(); continue; case 10: if (tag !== 80) { break; } message.multipleLightMode = reader.int32() as any; continue; case 11: if (tag !== 88) { break; } message.comfortSenseEnabled = reader.bool(); continue; case 12: if (tag !== 96) { break; } message.comfortSenseIdealTemp = reader.uint32(); continue; case 13: if (tag !== 104) { break; } message.comfortSenseMinSpeed = reader.uint32(); continue; case 14: if (tag !== 112) { break; } message.comfortSenseMaxSpeed = reader.uint32(); continue; case 15: if (tag !== 120) { break; } message.fanOccupancyEnabled = reader.bool(); continue; case 16: if (tag !== 128) { break; } message.fanOccupancyTimeout = reader.uint32(); continue; case 17: if (tag !== 136) { break; } message.lightOccupancyEnabled = reader.bool(); continue; case 18: if (tag !== 144) { break; } message.lightOccupancyTimeout = reader.uint32(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): ScheduleProperty { return { fanMode: isSet(object.fanMode) ? operatingModeFromJSON(object.fanMode) : undefined, fanDirection: isSet(object.fanDirection) ? directionFromJSON(object.fanDirection) : undefined, fanSpeed: isSet(object.fanSpeed) ? globalThis.Number(object.fanSpeed) : undefined, fanPercent: isSet(object.fanPercent) ? globalThis.Number(object.fanPercent) : undefined, lightMode: isSet(object.lightMode) ? operatingModeFromJSON(object.lightMode) : undefined, lightLevel: isSet(object.lightLevel) ? globalThis.Number(object.lightLevel) : undefined, lightColorTemperature: isSet(object.lightColorTemperature) ? globalThis.Number(object.lightColorTemperature) : undefined, lightPercent: isSet(object.lightPercent) ? globalThis.Number(object.lightPercent) : undefined, uplightPercent: isSet(object.uplightPercent) ? globalThis.Number(object.uplightPercent) : undefined, multipleLightMode: isSet(object.multipleLightMode) ? multipleLightModeFromJSON(object.multipleLightMode) : undefined, comfortSenseEnabled: isSet(object.comfortSenseEnabled) ? globalThis.Boolean(object.comfortSenseEnabled) : undefined, comfortSenseIdealTemp: isSet(object.comfortSenseIdealTemp) ? globalThis.Number(object.comfortSenseIdealTemp) : undefined, comfortSenseMinSpeed: isSet(object.comfortSenseMinSpeed) ? globalThis.Number(object.comfortSenseMinSpeed) : undefined, comfortSenseMaxSpeed: isSet(object.comfortSenseMaxSpeed) ? globalThis.Number(object.comfortSenseMaxSpeed) : undefined, fanOccupancyEnabled: isSet(object.fanOccupancyEnabled) ? globalThis.Boolean(object.fanOccupancyEnabled) : undefined, fanOccupancyTimeout: isSet(object.fanOccupancyTimeout) ? globalThis.Number(object.fanOccupancyTimeout) : undefined, lightOccupancyEnabled: isSet(object.lightOccupancyEnabled) ? globalThis.Boolean(object.lightOccupancyEnabled) : undefined, lightOccupancyTimeout: isSet(object.lightOccupancyTimeout) ? globalThis.Number(object.lightOccupancyTimeout) : undefined, }; }, toJSON(message: ScheduleProperty): unknown { const obj: any = {}; if (message.fanMode !== undefined) { obj.fanMode = operatingModeToJSON(message.fanMode); } if (message.fanDirection !== undefined) { obj.fanDirection = directionToJSON(message.fanDirection); } if (message.fanSpeed !== undefined) { obj.fanSpeed = Math.round(message.fanSpeed); } if (message.fanPercent !== undefined) { obj.fanPercent = Math.round(message.fanPercent); } if (message.lightMode !== undefined) { obj.lightMode = operatingModeToJSON(message.lightMode); } if (message.lightLevel !== undefined) { obj.lightLevel = Math.round(message.lightLevel); } if (message.lightColorTemperature !== undefined) { obj.lightColorTemperature = Math.round(message.lightColorTemperature); } if (message.lightPercent !== undefined) { obj.lightPercent = Math.round(message.lightPercent); } if (message.uplightPercent !== undefined) { obj.uplightPercent = Math.round(message.uplightPercent); } if (message.multipleLightMode !== undefined) { obj.multipleLightMode = multipleLightModeToJSON(message.multipleLightMode); } if (message.comfortSenseEnabled !== undefined) { obj.comfortSenseEnabled = message.comfortSenseEnabled; } if (message.comfortSenseIdealTemp !== undefined) { obj.comfortSenseIdealTemp = Math.round(message.comfortSenseIdealTemp); } if (message.comfortSenseMinSpeed !== undefined) { obj.comfortSenseMinSpeed = Math.round(message.comfortSenseMinSpeed); } if (message.comfortSenseMaxSpeed !== undefined) { obj.comfortSenseMaxSpeed = Math.round(message.comfortSenseMaxSpeed); } if (message.fanOccupancyEnabled !== undefined) { obj.fanOccupancyEnabled = message.fanOccupancyEnabled; } if (message.fanOccupancyTimeout !== undefined) { obj.fanOccupancyTimeout = Math.round(message.fanOccupancyTimeout); } if (message.lightOccupancyEnabled !== undefined) { obj.lightOccupancyEnabled = message.lightOccupancyEnabled; } if (message.lightOccupancyTimeout !== undefined) { obj.lightOccupancyTimeout = Math.round(message.lightOccupancyTimeout); } return obj; }, create, I>>(base?: I): ScheduleProperty { return ScheduleProperty.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): ScheduleProperty { const message = createBaseScheduleProperty(); message.fanMode = object.fanMode ?? undefined; message.fanDirection = object.fanDirection ?? undefined; message.fanSpeed = object.fanSpeed ?? undefined; message.fanPercent = object.fanPercent ?? undefined; message.lightMode = object.lightMode ?? undefined; message.lightLevel = object.lightLevel ?? undefined; message.lightColorTemperature = object.lightColorTemperature ?? undefined; message.lightPercent = object.lightPercent ?? undefined; message.uplightPercent = object.uplightPercent ?? undefined; message.multipleLightMode = object.multipleLightMode ?? undefined; message.comfortSenseEnabled = object.comfortSenseEnabled ?? undefined; message.comfortSenseIdealTemp = object.comfortSenseIdealTemp ?? undefined; message.comfortSenseMinSpeed = object.comfortSenseMinSpeed ?? undefined; message.comfortSenseMaxSpeed = object.comfortSenseMaxSpeed ?? undefined; message.fanOccupancyEnabled = object.fanOccupancyEnabled ?? undefined; message.fanOccupancyTimeout = object.fanOccupancyTimeout ?? undefined; message.lightOccupancyEnabled = object.lightOccupancyEnabled ?? undefined; message.lightOccupancyTimeout = object.lightOccupancyTimeout ?? undefined; return message; }, }; function createBaseScheduleJob(): ScheduleJob { return { action: 0, schedule: undefined, schedulesCount: 0, schedulesMax: 0 }; } export const ScheduleJob = { encode(message: ScheduleJob, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.action !== 0) { writer.uint32(8).int32(message.action); } if (message.schedule !== undefined) { ScheduleJob_Schedule.encode(message.schedule, writer.uint32(18).fork()).ldelim(); } if (message.schedulesCount !== 0) { writer.uint32(24).uint32(message.schedulesCount); } if (message.schedulesMax !== 0) { writer.uint32(32).uint32(message.schedulesMax); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ScheduleJob { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseScheduleJob(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.action = reader.int32() as any; continue; case 2: if (tag !== 18) { break; } message.schedule = ScheduleJob_Schedule.decode(reader, reader.uint32()); continue; case 3: if (tag !== 24) { break; } message.schedulesCount = reader.uint32(); continue; case 4: if (tag !== 32) { break; } message.schedulesMax = reader.uint32(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): ScheduleJob { return { action: isSet(object.action) ? scheduleJob_ActionFromJSON(object.action) : 0, schedule: isSet(object.schedule) ? ScheduleJob_Schedule.fromJSON(object.schedule) : undefined, schedulesCount: isSet(object.schedulesCount) ? globalThis.Number(object.schedulesCount) : 0, schedulesMax: isSet(object.schedulesMax) ? globalThis.Number(object.schedulesMax) : 0, }; }, toJSON(message: ScheduleJob): unknown { const obj: any = {}; if (message.action !== 0) { obj.action = scheduleJob_ActionToJSON(message.action); } if (message.schedule !== undefined) { obj.schedule = ScheduleJob_Schedule.toJSON(message.schedule); } if (message.schedulesCount !== 0) { obj.schedulesCount = Math.round(message.schedulesCount); } if (message.schedulesMax !== 0) { obj.schedulesMax = Math.round(message.schedulesMax); } return obj; }, create, I>>(base?: I): ScheduleJob { return ScheduleJob.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): ScheduleJob { const message = createBaseScheduleJob(); message.action = object.action ?? 0; message.schedule = (object.schedule !== undefined && object.schedule !== null) ? ScheduleJob_Schedule.fromPartial(object.schedule) : undefined; message.schedulesCount = object.schedulesCount ?? 0; message.schedulesMax = object.schedulesMax ?? 0; return message; }, }; function createBaseScheduleJob_Schedule(): ScheduleJob_Schedule { return { id: 0, name: "", devices: [], days: [], isEnabled: false, startEvent: undefined, endEvent: undefined }; } export const ScheduleJob_Schedule = { encode(message: ScheduleJob_Schedule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.id !== 0) { writer.uint32(8).uint32(message.id); } if (message.name !== "") { writer.uint32(18).string(message.name); } for (const v of message.devices) { writer.uint32(26).bytes(v!); } writer.uint32(34).fork(); for (const v of message.days) { writer.int32(v); } writer.ldelim(); if (message.isEnabled === true) { writer.uint32(48).bool(message.isEnabled); } if (message.startEvent !== undefined) { ScheduleJob_Schedule_ScheduleEvent.encode(message.startEvent, writer.uint32(58).fork()).ldelim(); } if (message.endEvent !== undefined) { ScheduleJob_Schedule_ScheduleEvent.encode(message.endEvent, writer.uint32(66).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ScheduleJob_Schedule { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseScheduleJob_Schedule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.id = reader.uint32(); continue; case 2: if (tag !== 18) { break; } message.name = reader.string(); continue; case 3: if (tag !== 26) { break; } message.devices.push(reader.bytes()); continue; case 4: if (tag === 32) { message.days.push(reader.int32() as any); continue; } if (tag === 34) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { message.days.push(reader.int32() as any); } continue; } break; case 6: if (tag !== 48) { break; } message.isEnabled = reader.bool(); continue; case 7: if (tag !== 58) { break; } message.startEvent = ScheduleJob_Schedule_ScheduleEvent.decode(reader, reader.uint32()); continue; case 8: if (tag !== 66) { break; } message.endEvent = ScheduleJob_Schedule_ScheduleEvent.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): ScheduleJob_Schedule { return { id: isSet(object.id) ? globalThis.Number(object.id) : 0, name: isSet(object.name) ? globalThis.String(object.name) : "", devices: globalThis.Array.isArray(object?.devices) ? object.devices.map((e: any) => bytesFromBase64(e)) : [], days: globalThis.Array.isArray(object?.days) ? object.days.map((e: any) => dayFromJSON(e)) : [], isEnabled: isSet(object.isEnabled) ? globalThis.Boolean(object.isEnabled) : false, startEvent: isSet(object.startEvent) ? ScheduleJob_Schedule_ScheduleEvent.fromJSON(object.startEvent) : undefined, endEvent: isSet(object.endEvent) ? ScheduleJob_Schedule_ScheduleEvent.fromJSON(object.endEvent) : undefined, }; }, toJSON(message: ScheduleJob_Schedule): unknown { const obj: any = {}; if (message.id !== 0) { obj.id = Math.round(message.id); } if (message.name !== "") { obj.name = message.name; } if (message.devices?.length) { obj.devices = message.devices.map((e) => base64FromBytes(e)); } if (message.days?.length) { obj.days = message.days.map((e) => dayToJSON(e)); } if (message.isEnabled === true) { obj.isEnabled = message.isEnabled; } if (message.startEvent !== undefined) { obj.startEvent = ScheduleJob_Schedule_ScheduleEvent.toJSON(message.startEvent); } if (message.endEvent !== undefined) { obj.endEvent = ScheduleJob_Schedule_ScheduleEvent.toJSON(message.endEvent); } return obj; }, create, I>>(base?: I): ScheduleJob_Schedule { return ScheduleJob_Schedule.fromPartial(base ?? ({} as any)); }, fromPartial, I>>(object: I): ScheduleJob_Schedule { const message = createBaseScheduleJob_Schedule(); message.id = object.id ?? 0; message.name = object.name ?? ""; message.devices = object.devices?.map((e) => e) || []; message.days = object.days?.map((e) => e) || []; message.isEnabled = object.isEnabled ?? false; message.startEvent = (object.startEvent !== undefined && object.startEvent !== null) ? ScheduleJob_Schedule_ScheduleEvent.fromPartial(object.startEvent) : undefined; message.endEvent = (object.endEvent !== undefined && object.endEvent !== null) ? ScheduleJob_Schedule_ScheduleEvent.fromPartial(object.endEvent) : undefined; return message; }, }; function createBaseScheduleJob_Schedule_ScheduleEvent(): ScheduleJob_Schedule_ScheduleEvent { return { time: "", properties: [] }; } export const ScheduleJob_Schedule_ScheduleEvent = { encode(message: ScheduleJob_Schedule_ScheduleEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.time !== "") { writer.uint32(10).string(message.time); } for (const v of message.properties) { ScheduleProperty.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): ScheduleJob_Schedule_ScheduleEvent { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseScheduleJob_Schedule_ScheduleEvent(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.time = reader.string(); continue; case 2: if (tag !== 18) { break; } message.properties.push(ScheduleProperty.decode(reader, reader.uint32())); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object: any): ScheduleJob_Schedule_ScheduleEvent { return { time: isSet(object.time) ? globalThis.String(object.time) : "", properties: globalThis.Array.isArray(object?.properties) ? object.properties.map((e: any) => ScheduleProperty.fromJSON(e)) : [], }; }, toJSON(message: ScheduleJob_Schedule_ScheduleEvent): unknown { const obj: any = {}; if (message.time !== "") { obj.time = message.time; } if (message.properties?.length) { obj.properties = message.properties.map((e) => ScheduleProperty.toJSON(e)); } return obj; }, create, I>>( base?: I, ): ScheduleJob_Schedule_ScheduleEvent { return ScheduleJob_Schedule_ScheduleEvent.fromPartial(base ?? ({} as any)); }, fromPartial, I>>( object: I, ): ScheduleJob_Schedule_ScheduleEvent { const message = createBaseScheduleJob_Schedule_ScheduleEvent(); message.time = object.time ?? ""; message.properties = object.properties?.map((e) => ScheduleProperty.fromPartial(e)) || []; return message; }, }; function bytesFromBase64(b64: string): Uint8Array { if ((globalThis as any).Buffer) { return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); } else { const bin = globalThis.atob(b64); const arr = new Uint8Array(bin.length); for (let i = 0; i < bin.length; ++i) { arr[i] = bin.charCodeAt(i); } return arr; } } function base64FromBytes(arr: Uint8Array): string { if ((globalThis as any).Buffer) { return globalThis.Buffer.from(arr).toString("base64"); } else { const bin: string[] = []; arr.forEach((byte) => { bin.push(globalThis.String.fromCharCode(byte)); }); return globalThis.btoa(bin.join("")); } } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; function longToNumber(long: Long): number { if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) { throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); } return long.toNumber(); } if (_m0.util.Long !== Long) { _m0.util.Long = Long as any; _m0.configure(); } function isSet(value: any): boolean { return value !== null && value !== undefined; }