lavva.exalushome.extalife
Version:
Library implementing communication and abstraction layers for ExtaLife API in ExalusHome system
2 lines • 21 kB
JavaScript
"use strict";(self.webpackChunklavva_exalushome_extalife=self.webpackChunklavva_exalushome_extalife||[]).push([[255],{2255:(e,n,t)=>{t.r(n),t.d(n,{RemoteServiceErrorCode:()=>w,RemotesService:()=>M});var i,a,o=t(1061),s=t(9595),r=t(6203),m=t(6823);!function(e){e[e.OnOff=1]="OnOff",e[e.Bistable=2]="Bistable",e[e.Monostable=3]="Monostable",e[e.Timer=4]="Timer",e[e.Local=5]="Local",e[e.Central=6]="Central",e[e.PixoBidi_1=7]="PixoBidi_1",e[e.PixoBidi_12=8]="PixoBidi_12",e[e.TwoButton=9]="TwoButton",e[e.OneButton=10]="OneButton",e[e.Comfort=11]="Comfort",e[e.TimerDimmer=12]="TimerDimmer",e[e.Gate=13]="Gate",e[e.GateWay=14]="GateWay",e[e.NXZFBidi=15]="NXZFBidi",e[e.PXZFBidi=16]="PXZFBidi",e[e.WSZFBidi=17]="WSZFBidi"}(i||(i={})),function(e){e[e.OnOff=1]="OnOff",e[e.Blind=2]="Blind",e[e.Dimmer=3]="Dimmer",e[e.Gate=4]="Gate",e[e.Gateway=5]="Gateway",e[e.Facade=6]="Facade"}(a||(a={})),a.OnOff,i.OnOff,i.OnOff,i.Bistable,i.Bistable,i.Monostable,i.Monostable,i.Timer,i.Timer,a.Blind,i.PixoBidi_1,i.PixoBidi_1,i.PixoBidi_12,i.PixoBidi_12,a.Dimmer,i.TwoButton,i.TwoButton,i.OneButton,i.OneButton,i.Comfort,i.Comfort,i.TimerDimmer,i.TimerDimmer,a.Gate,i.Gate,i.Gate,i.Bistable,i.Bistable,a.Gateway,i.GateWay,i.GateWay,i.Bistable,i.Bistable,a.Facade,i.NXZFBidi,i.NXZFBidi,i.PXZFBidi,i.PXZFBidi,i.WSZFBidi,i.WSZFBidi;class l{constructor(e,n){this._remoteChannels=e,this._keyOn=n.KeyOn,this._keyOff=n.KeyOff}get KeyOn(){return this._keyOn}get KeyOff(){return this._keyOff}set KeyOn(e){this._keyOn=e}set KeyOff(e){this._keyOff=e}}class c{constructor(e,n){this._remoteChannels=e,this._channel=n.Channel}get Channel(){return this._channel}set Channel(e){this._channel=e}}class d{constructor(e,n){this._remoteChannels=e,this._keyOn=n.KeyOn}get KeyOn(){return this._keyOn}set KeyOn(e){this._keyOn=e}}class u{constructor(e,n){this._remoteChannels=e,this._keyOn=n.KeyOn,this._timeOn=n.TimeOn}get KeyOn(){return this._keyOn}set KeyOn(e){this._keyOn=e}get TimeOn(){return this._timeOn}set TimeOn(e){this._timeOn=e}}class h{constructor(e,n){this._remoteChannels=e,this._keyOn=n.KeyOn,this._keyOff=n.KeyOff,this._keyBrightening=n.KeyBrightening,this._keyDimmer=n.KeyDimmer}get KeyOn(){return this._keyOn}set KeyOn(e){this._keyOn=e}get KeyOff(){return this._keyOff}set KeyOff(e){this._keyOff=e}get KeyBrightening(){return this._keyBrightening}set KeyBrightening(e){this._keyBrightening=e}get KeyDimmer(){return this._keyDimmer}set KeyDimmer(e){this._keyDimmer=e}}class O{constructor(e,n){this.ModeParams={[i.OnOff]:new l(e,n),[i.Bistable]:new d(e,n),[i.Monostable]:new d(e,n),[i.Timer]:new u(e,n)}}}class y{constructor(e,n){this.ModeParams={[i.PixoBidi_1]:new c(e,n),[i.PixoBidi_12]:new c(e,n)}}}class p{constructor(e,n){this.ModeParams={[i.TwoButton]:new l(e,n),[i.OneButton]:new d(e,n),[i.Comfort]:new h(e,n),[i.TimerDimmer]:new u(e,n)}}}class f{constructor(e,n){this.ModeParams={[i.Gate]:new d(e,n),[i.Bistable]:new d(e,n)}}}class g{constructor(e,n){this.ModeParams={[i.GateWay]:new d(e,n),[i.Bistable]:new d(e,n)}}}class R{constructor(e,n){this.ModeParams={[i.NXZFBidi]:new c(e,n),[i.PXZFBidi]:new c(e,n),[i.WSZFBidi]:null}}}class C{constructor(e){switch(this._configs={},this._deviceGuid="",this._channel=0,this._guid="",this._name="",this._remoteChannelAmount=0,this._deviceChannelAmount=0,this._deviceType=a.OnOff,this._remoteMode=i.OnOff,this._deviceGuid=e.DeviceGuid,this._channel=e.Channel,this._guid=e.Guid,this._name=e.Name,this._remoteChannelAmount=e.RemoteChannelAmount,this._deviceChannelAmount=e.DeviceChannelAmount,this._deviceType=e.DeviceType,this._remoteMode=e.PairingOption.Mode,this._rawCurrentRemoteOptions=e.PairingOption,this._rawOldRemoteOptions=e.OldSettingsOptional,e.DeviceType){case a.OnOff:this._configs.OnOffOptions=new O(this._remoteChannelAmount,e.PairingOption);break;case a.Blind:this._configs.BlindOptions=new y(this._remoteChannelAmount,e.PairingOption);break;case a.Dimmer:this._configs.DimmerOptions=new p(this._remoteChannelAmount,e.PairingOption);break;case a.Gate:this._configs.GateOptions=new f(this._remoteChannelAmount,e.PairingOption);break;case a.Gateway:this._configs.GateWayOptions=new g(this._remoteChannelAmount,e.PairingOption);break;case a.Facade:this._configs.FacadeOptions=new R(this._remoteChannelAmount,e.PairingOption)}this._currentRemotePairingOptions={[a.OnOff]:this._configs.OnOffOptions,[a.Blind]:this._configs.BlindOptions,[a.Dimmer]:this._configs.DimmerOptions,[a.Gate]:this._configs.GateOptions,[a.Gateway]:this._configs.GateWayOptions,[a.Facade]:this._configs.FacadeOptions}}get DeviceGuid(){return this._deviceGuid}set DeviceGuid(e){this._deviceGuid=e}get Channel(){return this._channel}set Channel(e){this._channel=e}get Guid(){return this._guid}set Guid(e){this._guid=e}get Name(){return this._name}set Name(e){this._name=e}get RemoteChannelAmount(){return this._remoteChannelAmount}get DeviceChannelAmount(){return this._deviceChannelAmount}get DeviceType(){return this._deviceType}set DeviceType(e){this._deviceType=e}get RemoteMode(){return this._remoteMode}set RemoteMode(e){this._remoteMode=e,this._rawCurrentRemoteOptions.Mode=e}get CurrentRemotePairingOptions(){return this._currentRemotePairingOptions}get RawCurrentRemoteOptions(){return this._rawCurrentRemoteOptions}get RawOldRemoteOptions(){return this._rawOldRemoteOptions}}var w,P,b=t(4756),v=t(9592),B=t(8883),G=function(e,n,t,i){return new(t||(t=Promise))((function(a,o){function s(e){try{m(i.next(e))}catch(e){o(e)}}function r(e){try{m(i.throw(e))}catch(e){o(e)}}function m(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,r)}m((i=i.apply(e,n||[])).next())}))};class M{constructor(){this._connection=o.j.Get(s.G.ServiceName)}GetServiceName(){return M.ServiceName}GetPairedRemotesAsync(e,n){return G(this,void 0,void 0,(function*(){var t;if(!e.Channels.any((e=>e.Number===n)))return new m.ZR(w.InvalidChannelNumber,`Cannot get paired remotes - invalid channel number, channel: ${n}`);const i=yield null===(t=this._connection)||void 0===t?void 0:t.SendAndWaitForResponseAsync(new K(new v.z(e.Guid,n)),16e3,!1);if(null==i||null==i.Status)return new m.ZR(w.OtherError,"Cannot get paired remotes - unknown error.");switch(i.Status){case b.nW.OK:break;case b.nW.NoData:return new m.ZR(w.NoPairedRemotes,"Cannot get paired remotes - no remote controls are paired with the device.");default:return new m.ZR(w.OtherError,`Cannot get paired remotes - controller responded with error code: ${i.Status}.`)}if(null==i.Data)return new m.ZR(w.NoData,"Cannot get paired remotes - no data in response.");const a=[];for(var o of i.Data)e.AvailableTaskTypes.any((e=>e.Type==r.MO.SetBlindPosition||e.Type==r.MO.SetFacadePosition))?a.push(new C(o)):o.Channel!=n&&o.PairingOption.Channel!=n||a.push(new C(o));return M._pairedRemoteCache.set(e.Guid,a),a}))}GetAvailableRemotesForDeviceAsync(e,n){return G(this,void 0,void 0,(function*(){const t=(e,n)=>{if(e.ProtocolGuid!=n.ProtocolGuid)return!1;if(e.AvailableResponseTypes.any((e=>e.Type==r.mQ.BlindRemoteButtonState||e.Type==r.mQ.FacadeRemoteButtonState)))switch(n.ModelGuid){case"1d69f5c5-1a1b-47c6-adb7-1349334c3c2f":case"31e4e5f6-f727-4249-b601-d5ba7ca75239":case"a789447a-e6c5-48f6-8414-c1f9555c22ec":case"a2adc7e0-00c6-4b67-9608-6f75f368f5e8":return!1}return!0},i=(yield o.j.Get(B.N7.ServiceName).GetDevicesAsync()).where((e=>e.DeviceType==r.bq.Remote&&e.AvailableResponseTypes.all((e=>e.Type!=r.mQ.MeasuredTemperature)))).toArray(),a=[];e.AvailableTaskTypes.any((e=>e.Type==r.MO.SetFacadePosition))&&i.push(...(yield o.j.Get(B.N7.ServiceName).GetDevicesAsync()).where((e=>"f48eab61-047a-4241-a1e6-aee89062cd69"==e.ModelGuid)).toArray()),i.forEach((i=>{const o=e.AvailableTaskTypes,s=i.AvailableResponseTypes.any((e=>e.Type==r.mQ.BlindRemoteButtonState||e.Type==r.mQ.FacadeRemoteButtonState));switch(e.ModelGuid){case"813d930e-4220-4a5f-b348-b0f731a07e5f":return void(s||t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.OnOffMultiple)));case"42015ac8-4a84-47b2-855d-795ee8edc06f":"90e73979-f0eb-40af-9879-5a73b65e2532"!=i.ModelGuid&&"d19efeee-4b76-47d2-8dc9-6f6a1b810ecb"!=i.ModelGuid||a.push(this.GenerateRemoteInitConfig(i,e,n,P.FacadeSingle));break;case"d1b4cfc7-e92c-47d1-9c7c-9c9dd3351832":"90e73979-f0eb-40af-9879-5a73b65e2532"!=i.ModelGuid&&"d19efeee-4b76-47d2-8dc9-6f6a1b810ecb"!=i.ModelGuid||a.push(this.GenerateRemoteInitConfig(i,e,n,P.BlindsSingle));break;case"824560d9-f83c-4ff6-99b7-0187bfda5d4e":switch(i.ModelGuid){case"1d69f5c5-1a1b-47c6-adb7-1349334c3c2f":case"31e4e5f6-f727-4249-b601-d5ba7ca75239":case"a789447a-e6c5-48f6-8414-c1f9555c22ec":case"a2adc7e0-00c6-4b67-9608-6f75f368f5e8":if(t(e,i))return void a.push(this.GenerateRemoteInitConfig(i,e,n,P.OnOffSingle))}return void(i.ChannelsAmount>1?t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.BlindsMultiple)):t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.BlindsSingle)))}o.any((e=>e.Type==r.MO.SetBlindPosition))?i.ChannelsAmount>1&&i.AvailableResponseTypes.any((e=>e.Type==r.mQ.BlindRemoteButtonState||e.Type==r.mQ.FacadeRemoteButtonState))?t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.BlindsMultiple)):i.AvailableResponseTypes.any((e=>e.Type==r.mQ.BlindRemoteButtonState||e.Type==r.mQ.FacadeRemoteButtonState))&&t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.BlindsSingle)):o.any((e=>e.Type==r.MO.SetFacadePosition))?i.ChannelsAmount>1&&i.AvailableResponseTypes.any((e=>e.Type==r.mQ.FacadeRemoteButtonState||e.Type==r.mQ.BlindRemoteButtonState))?t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.FacadeMultiple)):i.AvailableResponseTypes.any((e=>e.Type==r.mQ.WindThreshold))?t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.FacadeWindSensor)):i.AvailableResponseTypes.any((e=>e.Type==r.mQ.FacadeRemoteButtonState||e.Type==r.mQ.BlindRemoteButtonState))&&t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.FacadeSingle)):o.any((e=>e.Type==r.MO.SetLightBrightness))&&!s?i.ChannelsAmount>1?t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.DimmerMultiple)):t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.DimmerSingle)):o.any((e=>e.Type==r.MO.ChangeGatePositionPulse))&&!s?t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.GateSingle)):o.any((e=>e.Type==r.MO.ChangeGatewayPositionPulse))&&!s?t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.GatewaySingle)):s||(i.ChannelsAmount>1?t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.OnOffMultiple)):t(e,i)&&a.push(this.GenerateRemoteInitConfig(i,e,n,P.OnOffSingle)))}));const s=M._pairedRemoteCache.get(e.Guid);if(null!=s)return a.filter((e=>!s.any((n=>e.Guid==n.Guid&&1==e.RemoteChannelAmount||17==e.RemoteMode&&17==n.RemoteMode))));{yield this.GetPairedRemotesAsync(e,n);const t=M._pairedRemoteCache.get(e.Guid);if(null!=t)return a.filter((e=>!t.any((n=>e.Guid==n.Guid&&1==e.RemoteChannelAmount))))}return a}))}EditRemoteOptionsAsync(e){return G(this,void 0,void 0,(function*(){var n;try{const t=yield null===(n=this._connection)||void 0===n?void 0:n.SendAndWaitForResponseAsync(new D(this.GenerateRemoteRawObject(e)),8e3,!1);return null==t||null==t.Status?new m.ZR(w.OtherError,"Cannot edit remote - unknown error."):t.Status!==b.nW.OK?new m.ZR(w.OtherError,`Cannot edit remote - controller responded with error code: ${t.Status}.`):t.Status}catch(e){switch(e.constructor){case k:return new m.ZR(w.IllegalButtonNumber,`Cannot assign remote options - ${e.message}.`);case F:return new m.ZR(w.ButtonAlreadyAssigned,`Cannot assign remote options - ${e.message}.`);case N:return new m.ZR(w.IllegalTimeValue,`Cannot assign remote options - ${e.message}.`);default:throw e}}}))}AssingRemoteToDeviceAsync(e){return G(this,void 0,void 0,(function*(){var n;try{const t=yield null===(n=this._connection)||void 0===n?void 0:n.SendAndWaitForResponseAsync(new A(this.GenerateRemoteRawObject(e)),8e3,!1);return null==t||null==t.Status?new m.ZR(w.OtherError,"Cannot assign remote - unknown error."):t.Status!==b.nW.OK?new m.ZR(w.OtherError,`Cannot assign remote - controller responded with error code: ${t.Status}.`):t.Status}catch(e){switch(e.constructor){case k:return new m.ZR(w.IllegalButtonNumber,`Cannot assign remote options - ${e.message}.`);case F:return new m.ZR(w.ButtonAlreadyAssigned,`Cannot assign remote options - ${e.message}.`);case N:return new m.ZR(w.IllegalTimeValue,`Cannot assign remote options - ${e.message}.`);default:throw e}}}))}RemoveRemoteFromDeviceAsync(e){return G(this,void 0,void 0,(function*(){var n;const t=yield null===(n=this._connection)||void 0===n?void 0:n.SendAndWaitForResponseAsync(new S(this.GenerateRemoteRawObject(e)),8e3,!1);return null==t||null==t.Status?(o.j.Get(M.ServiceName).Debug("Cannot delete remote - controler response is empty!"),b.nW.FatalError):t.Status}))}GenerateRemoteInitConfig(e,n,t,o){let s=a.OnOff;const r=new _;switch(o){case P.FacadeWindSensor:r.Mode=i.WSZFBidi,r.KeyOn=1,r.KeyOff=3,r.TimeOn=5,r.Channel=1,s=a.Facade;break;case P.FacadeSingle:r.Mode=i.PXZFBidi,r.KeyOn=1,r.KeyOff=3,r.TimeOn=5,r.Channel=1,s=a.Facade;break;case P.FacadeMultiple:r.Mode=i.NXZFBidi,r.Channel=1,s=a.Facade;break;case P.BlindsSingle:r.Mode=i.PixoBidi_1,r.KeyOn=1,r.KeyOff=3,r.TimeOn=5,r.Channel=1,s=a.Blind;break;case P.BlindsMultiple:r.Mode=i.PixoBidi_12,r.Channel=1,s=a.Blind;break;case P.DimmerSingle:case P.DimmerMultiple:r.Mode=i.TimerDimmer,r.TimeOn=10,r.KeyOn=1,s=a.Dimmer;break;case P.OnOffSingle:case P.OnOffMultiple:r.Mode=i.Bistable,r.KeyOn=1,s=a.OnOff;break;case P.GateSingle:case P.GateMultiple:r.Mode=i.Gate,s=a.Gate;break;case P.GatewaySingle:case P.GatewayMultiple:r.Mode=i.GateWay,s=a.Gateway}const m=new T;return m.Name=e.Name,m.Guid=e.Guid,m.DeviceGuid=n.Guid,m.Channel=t,m.RemoteChannelAmount=e.ChannelsAmount,m.PairingOption=r,m.DeviceType=s,new C(m)}GenerateRemoteRawObject(e){const n=new T;switch(n.DeviceGuid=e.DeviceGuid,n.Channel=e.Channel,n.Guid=e.Guid,n.Name=e.Name,n.RemoteChannelAmount=e.RemoteChannelAmount,n.DeviceChannelAmount=e.DeviceChannelAmount,n.OldSettingsOptional=Object.assign({},e.RawCurrentRemoteOptions),n.DeviceType=e.DeviceType,n.PairingOption=e.RawCurrentRemoteOptions,e.DeviceType){case a.OnOff:switch(e.RemoteMode){case i.OnOff:if(n.PairingOption.KeyOn=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyOn,n.PairingOption.KeyOff=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyOff,n.PairingOption.KeyOff==n.PairingOption.KeyOn)throw new F("KeyOn and KeyOff are assigned to the same button!");if(n.PairingOption.KeyOff>e.RemoteChannelAmount||n.PairingOption.KeyOn>e.RemoteChannelAmount)throw new k(`KeyOn and KeyOff number should be between 0 and ${e.RemoteChannelAmount}`);break;case i.Monostable:case i.Bistable:if(n.PairingOption.KeyOn=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyOn,n.PairingOption.KeyOn>e.RemoteChannelAmount)throw new k(`KeyOn number should be between 0 and ${e.RemoteChannelAmount}`);break;case i.Timer:if(n.PairingOption.KeyOn=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyOn,n.PairingOption.TimeOn=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].TimeOn,n.PairingOption.KeyOn>e.RemoteChannelAmount)throw new k(`KeyOn number should be between 0 and ${e.RemoteChannelAmount}`);if(n.PairingOption.TimeOn>65535||n.PairingOption.TimeOn<1)throw new N("TimeOn must be in range between 0 and 65535 seconds")}break;case a.Blind:switch(e.RemoteMode){case i.PixoBidi_1:case i.PixoBidi_12:if(n.PairingOption.Channel=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].Channel,n.Channel=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].Channel,n.PairingOption.Channel>e.RemoteChannelAmount)throw new k(`Channel number should be between 0 and ${e.RemoteChannelAmount}`)}break;case a.Dimmer:switch(e.RemoteMode){case i.TwoButton:if(n.PairingOption.KeyOn=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyOn,n.PairingOption.KeyOff=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyOff,n.PairingOption.KeyOff==n.PairingOption.KeyOn)throw new F("KeyOn and KeyOff are assigned to the same button!");if(n.PairingOption.KeyOff>e.RemoteChannelAmount||n.PairingOption.KeyOn>e.RemoteChannelAmount)throw new k(`KeyOn and KeyOff number should be between 0 and ${e.RemoteChannelAmount}`);break;case i.OneButton:if(n.PairingOption.KeyOn=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyOn,n.PairingOption.KeyOn>e.RemoteChannelAmount)throw new k(`KeyOn number should be between 0 and ${e.RemoteChannelAmount}`);break;case i.Comfort:n.PairingOption.KeyOn=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyOn,n.PairingOption.KeyOff=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyOff,n.PairingOption.KeyDimmer=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyDimmer,n.PairingOption.KeyBrightening=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyBrightening;const t=[];if(t.push(n.PairingOption.KeyOn),t.push(n.PairingOption.KeyOff),t.push(n.PairingOption.KeyDimmer),t.push(n.PairingOption.KeyBrightening),t.filter(((e,n,t)=>t.indexOf(e)!==n)).length>0)throw new F("KeyOn, KeyOff, KeyDimmer or KeyBrightening are assigned to the same button!");if(t.any((n=>n>e.RemoteChannelAmount)))throw new k(`KeyOn number should be between 0 and ${e.RemoteChannelAmount}`);break;case i.TimerDimmer:if(n.PairingOption.KeyOn=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyOn,n.PairingOption.TimeOn=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].TimeOn,n.PairingOption.KeyOn>e.RemoteChannelAmount)throw new k(`KeyOn number should be between 0 and ${e.RemoteChannelAmount}`);if(n.PairingOption.TimeOn>65535||n.PairingOption.TimeOn<1)throw new N("TimeOn must be in range between 0 and 65535 seconds")}break;case a.Gate:switch(e.RemoteMode){case i.Gate:case i.Bistable:if(n.PairingOption.KeyOn=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyOn,n.PairingOption.KeyOn>e.RemoteChannelAmount)throw new k(`KeyOn number should be between 0 and ${e.RemoteChannelAmount}`)}break;case a.Gateway:switch(e.RemoteMode){case i.GateWay:case i.Bistable:if(n.PairingOption.KeyOn=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].KeyOn,n.PairingOption.KeyOn>e.RemoteChannelAmount)throw new k(`KeyOn number should be between 0 and ${e.RemoteChannelAmount}`)}break;case a.Facade:switch(e.RemoteMode){case i.NXZFBidi:case i.PXZFBidi:if(n.PairingOption.Channel=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].Channel,n.Channel=e.CurrentRemotePairingOptions[e.DeviceType].ModeParams[e.RemoteMode].Channel,n.PairingOption.Channel>e.RemoteChannelAmount)throw new k(`Channel number should be between 0 and ${e.RemoteChannelAmount}`)}}return n}}M._pairedRemoteCache=new Map,M.ServiceName="RemotesService",function(e){e.OtherError="OtherError",e.InvalidChannelNumber="InvalidChannelNumber",e.NoData="NoData",e.IllegalButtonNumber="IllegalButtonNumber",e.ButtonAlreadyAssigned="ButtonAlreadyAssigned",e.IllegalTimeValue="IllegalTimeValue",e.NoPairedRemotes="NoPairedRemotes"}(w||(w={})),function(e){e[e.FacadeWindSensor=-1]="FacadeWindSensor",e[e.FacadeSingle=0]="FacadeSingle",e[e.FacadeMultiple=1]="FacadeMultiple",e[e.BlindsSingle=2]="BlindsSingle",e[e.BlindsMultiple=3]="BlindsMultiple",e[e.DimmerSingle=4]="DimmerSingle",e[e.DimmerMultiple=5]="DimmerMultiple",e[e.OnOffSingle=6]="OnOffSingle",e[e.OnOffMultiple=7]="OnOffMultiple",e[e.GateSingle=8]="GateSingle",e[e.GateMultiple=9]="GateMultiple",e[e.GatewaySingle=10]="GatewaySingle",e[e.GatewayMultiple=11]="GatewayMultiple"}(P||(P={}));class T{constructor(){this.DeviceGuid="",this.Channel=0,this.Guid="",this.Name="",this.RemoteChannelAmount=0,this.DeviceChannelAmount=0,this.PairingOption=new _,this.OldSettingsOptional=new _,this.DeviceType=a.OnOff}}class _{constructor(){this.Mode=i.Bistable,this.KeyOn=0,this.KeyOff=0,this.KeyBrightening=0,this.KeyDimmer=0,this.TimeOn=0,this.Channel=0}}class K extends b.CP{constructor(e){super(),this.Resource="/extalife/device/remote/list",this.Method=b.IT.Get,this.Data=e}}class D extends b.CP{constructor(e){super(),this.Resource="/extalife/device/remote/editNew",this.Method=b.IT.Post,this.Data=e}}class A extends b.CP{constructor(e){super(),this.Resource="/extalife/device/remote/add",this.Method=b.IT.Post,this.Data=e}}class S extends b.CP{constructor(e){super(),this.Resource="/extalife/device/remote/delate",this.Method=b.IT.Delete,this.Data=e}}class k extends Error{constructor(e){super(e),this.message=e,this.name="IllegalButtonNumber"}}class F extends Error{constructor(e){super(e),this.message=e,this.name="ButtonAlreadyAssigned"}}class N extends Error{constructor(e){super(e),this.message=e,this.name="IllegalTimeValue"}}},9592:(e,n,t)=>{t.d(n,{o:()=>i,z:()=>a});class i{constructor(e){this.DeviceGuid="",this.DeviceGuid=e}}class a{constructor(e,n){this.DeviceGuid="",this.Channel=0,this.DeviceGuid=e,this.Channel=n}}}}]);
//# sourceMappingURL=255-exalushome-extalife.bundle.js.map