UNPKG

@strato-automation/node-red-contrib-strato-automation

Version:
1 lines 6.62 kB
function a10_0x3225(){const _0x1a7377=['\x20objects\x20written','__doWork','value','_ipRetryCount','_maxMstpObjectsToWrite','info','deviceInstance','_maxIpObjectsToWrite','330tHkaXY','values','catch','options','_ipObjectToWriteMap','/api/v1','_ipTimeout','274016igScRv','exports','44sJebVc','objectType','writeMultiplePropery','priority','getTime','_mstpMinSendTime','Error\x20writing\x20to\x20device\x20','errorCallback','propertyId','_mstpTimeout','events','clear','status','callStatsEmitter','834978YOOOER','statusText','error','515642SKvQoX','56JxiSyt','ocn_ip','objectInstance','call-stats','_mstpRetryCount','11145OuCjdX','slice','4561002wIKIyS','../lib/ocnApiClient.js','_mstpObjectToWriteMap','writeMstpObject','log','_mstpInterval','length','6954376jpOTEj','./bacnet.js','push','https://','size','nodeRed','emit','_ipInterval','_ipMinSendTime','set','then','171252KcbJDg','3kkVwnP','map','undefined','12bLRKRc'];a10_0x3225=function(){return _0x1a7377;};return a10_0x3225();}const a10_0x38242a=a10_0xfb6c;(function(_0x4361ec,_0x1610d9){const _0x45856f=a10_0xfb6c,_0x3c6c26=_0x4361ec();while(!![]){try{const _0x2a9a5e=-parseInt(_0x45856f(0xf3))/0x1+parseInt(_0x45856f(0xf6))/0x2*(parseInt(_0x45856f(0xd0))/0x3)+parseInt(_0x45856f(0xe5))/0x4*(-parseInt(_0x45856f(0xfc))/0x5)+parseInt(_0x45856f(0xfe))/0x6+parseInt(_0x45856f(0xf7))/0x7*(parseInt(_0x45856f(0xe3))/0x8)+-parseInt(_0x45856f(0xcf))/0x9*(-parseInt(_0x45856f(0xdc))/0xa)+parseInt(_0x45856f(0x105))/0xb*(-parseInt(_0x45856f(0xd3))/0xc);if(_0x2a9a5e===_0x1610d9)break;else _0x3c6c26['push'](_0x3c6c26['shift']());}catch(_0x3e058f){_0x3c6c26['push'](_0x3c6c26['shift']());}}}(a10_0x3225,0x688b7));function a10_0xfb6c(_0x3bcbcd,_0x469949){const _0x3225cd=a10_0x3225();return a10_0xfb6c=function(_0xfb6c3a,_0x52b1c1){_0xfb6c3a=_0xfb6c3a-0xca;let _0x36203=_0x3225cd[_0xfb6c3a];return _0x36203;},a10_0xfb6c(_0x3bcbcd,_0x469949);}const OCNAPIClient=require(a10_0x38242a(0xff)),{parseBacnetTypeToInt}=require(a10_0x38242a(0x106)),EventEmitter=require(a10_0x38242a(0xef));class PresentValueUpdateService{['_ipObjectToWriteMap']=new Map();[a10_0x38242a(0x100)]=new Map();constructor(_0x2d07f2,_0x39d296,_0x532825,_0x3d10a9,_0x12ca8b,_0x19a4f6,_0x595ab0,_0x2f6e9f,_0x5a7582,_0x1ae64d){const _0x49e2d1=a10_0x38242a;this['errorCallback']=_0x2d07f2,this[_0x49e2d1(0xdb)]=0x28,this[_0x49e2d1(0xd8)]=0xf,this[_0x49e2d1(0xcb)]=_0x39d296||0x1f4,this['_ipMinSendTime']=_0x532825||0x64,this['_ipTimeout']=_0x3d10a9||0x3e8,this[_0x49e2d1(0xd7)]=_0x12ca8b||0x2,this[_0x49e2d1(0x103)]=_0x19a4f6||0x64,this[_0x49e2d1(0xea)]=_0x595ab0||0x1f4,this[_0x49e2d1(0xee)]=_0x2f6e9f||0xbb8,this[_0x49e2d1(0xfb)]=_0x5a7582||0x2,this[_0x49e2d1(0xf2)]=new EventEmitter(),this[_0x49e2d1(0x10a)]=_0x1ae64d,setTimeout(()=>{const _0x42b8e9=_0x49e2d1;this[_0x42b8e9(0xd5)](this[_0x42b8e9(0xcb)],this[_0x42b8e9(0xe0)],this[_0x42b8e9(0xdb)],this[_0x42b8e9(0xcc)],this[_0x42b8e9(0xe2)],this[_0x42b8e9(0xd7)]);},this[_0x49e2d1(0xcb)]),setTimeout(()=>{const _0x1f4fde=_0x49e2d1;this[_0x1f4fde(0xd5)](this[_0x1f4fde(0x103)],this[_0x1f4fde(0x100)],this[_0x1f4fde(0xd8)],this['_mstpMinSendTime'],this['_mstpTimeout'],this['_mstpRetryCount']);},this[_0x49e2d1(0x103)]);}async[a10_0x38242a(0xd5)](_0x24066d,_0x387b99,_0x494809,_0x19110a,_0x4c11b1,_0x568bd5){const _0x97672=a10_0x38242a;try{const _0x1291cd=new Map();if(!_0x387b99||_0x387b99[_0x97672(0x109)]==0x0)return;for(const [_0x1a2753,_0x2d951f]of _0x387b99){if(!_0x1291cd['has'](''+_0x2d951f[_0x97672(0xda)]))_0x1291cd[_0x97672(0xcd)](''+_0x2d951f['deviceInstance'],[]);_0x1291cd['get'](''+_0x2d951f[_0x97672(0xda)])[_0x97672(0x107)](_0x2d951f);}_0x387b99[_0x97672(0xf0)]();for(const [_0xcf9d75,_0x102b16]of _0x1291cd){const _0x34b696=[];for(let _0x2840fe=0x0;_0x2840fe<_0x102b16?.[_0x97672(0x104)];_0x2840fe+=_0x494809){_0x34b696[_0x97672(0x107)](_0x102b16[_0x97672(0xfd)](_0x2840fe,_0x2840fe+_0x494809));}_0x1291cd[_0x97672(0xcd)](_0xcf9d75,_0x34b696);}for(const [_0x4c73bb,_0x295166]of _0x1291cd){if(_0x295166[0x0]===undefined)continue;if(_0x295166[0x0][0x0]===undefined)continue;const _0x5abe6f=_0x295166[0x0][0x0]['deviceInstance'];for(const _0x20a535 of _0x295166){const _0x20428f={'values':_0x20a535[_0x97672(0xd1)](_0x5c4b4c=>{const _0xcc01b2=_0x97672;return{'objectType':parseBacnetTypeToInt(_0x5c4b4c[_0xcc01b2(0xe6)]),'objectInstance':Number(_0x5c4b4c[_0xcc01b2(0xf9)]),'propertyId':Number(_0x5c4b4c[_0xcc01b2(0xdf)][_0xcc01b2(0xed)]),'priority':Number(_0x5c4b4c[_0xcc01b2(0xdf)][_0xcc01b2(0xe8)]),'value':_0x5c4b4c[_0xcc01b2(0xdf)][_0xcc01b2(0xd6)]};}),'retryCount':_0x568bd5,'timeoutMs':_0x4c11b1},_0xf55814=new Date()['getTime']();new OCNAPIClient(_0x97672(0x108)+_0x20a535[0x0][_0x97672(0xf8)]+_0x97672(0xe1),_0x20a535[0x0]['ocn_token'],this['nodeRed'])[_0x97672(0xe7)](_0x5abe6f,_0x20428f)[_0x97672(0xce)](_0x1c08ea=>{const _0x52e62b=_0x97672,_0x8e0d28=new Date()[_0x52e62b(0xe9)]();!_0x1c08ea['ok']?this[_0x52e62b(0xec)](_0x52e62b(0xeb)+_0x5abe6f+'\x20'+_0x1c08ea[_0x52e62b(0xf4)]+'\x20('+_0x1c08ea['status']+')'):this[_0x52e62b(0x10a)]['log'][_0x52e62b(0xd9)](_0x20428f['values']?.['length']+_0x52e62b(0xd4)),this[_0x52e62b(0xf2)][_0x52e62b(0xca)](_0x52e62b(0xfa),{'deviceInstance':_0x5abe6f,'objectCount':_0x20428f[_0x52e62b(0xdd)]?.[_0x52e62b(0x104)],'objects':_0x20428f[_0x52e62b(0xdd)],'time':_0x8e0d28-_0xf55814,'status':_0x1c08ea[_0x52e62b(0xf1)]});})[_0x97672(0xde)](_0x38d11c=>{const _0x34bf0a=_0x97672;this[_0x34bf0a(0x10a)][_0x34bf0a(0x102)][_0x34bf0a(0xf5)](_0x38d11c),this['errorCallback'](_0x38d11c);}),await new Promise(_0x2cc380=>setTimeout(_0x2cc380,_0x19110a));}}}catch(_0x19258b){this[_0x97672(0x10a)]['log']['error'](_0x19258b);}finally{setTimeout(()=>{const _0x3ba861=_0x97672;this[_0x3ba861(0xd5)](_0x24066d,_0x387b99,_0x494809,_0x19110a,_0x4c11b1,_0x568bd5);},_0x24066d);}}['writeIpObject'](_0x5e6b43,_0x153a62,_0x41af97,_0x26f33f,_0x3a2adb,_0x5d2026){const _0x4ebafa=a10_0x38242a,_0x43d216=_0x41af97+'-'+_0x26f33f+'-'+_0x3a2adb;this[_0x4ebafa(0xe0)][_0x4ebafa(0xcd)](_0x43d216,{'ocn_ip':_0x5e6b43,'ocn_token':_0x153a62,'deviceInstance':_0x41af97,'objectType':_0x26f33f,'objectInstance':_0x3a2adb,'options':_0x5d2026});}[a10_0x38242a(0x101)](_0x3b7ad8,_0x3daad9,_0x5f1f09,_0x23e225,_0x428e64,_0x26b7b6){const _0x9c3f26=a10_0x38242a,_0x5c985f=_0x5f1f09+'-'+_0x23e225+'-'+_0x428e64;this[_0x9c3f26(0x100)]['set'](_0x5c985f,{'ocn_ip':_0x3b7ad8,'ocn_token':_0x3daad9,'deviceInstance':_0x5f1f09,'objectType':_0x23e225,'objectInstance':_0x428e64,'options':_0x26b7b6});}}typeof module!==a10_0x38242a(0xd2)&&typeof module[a10_0x38242a(0xe4)]!==a10_0x38242a(0xd2)&&(module[a10_0x38242a(0xe4)]=PresentValueUpdateService);