{"size": 4566, "ext": "js", "max_stars_repo_path": "buildroot-external/package/neoserver/pkg/mediola/neo_server/node_modules/xnm.aio.zwave.js", "max_stars_repo_name": "Maik2208/RaspberryMatic", "max_stars_repo_stars_event_min_datetime": "2016-08-12T12:36:01.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T05:32:22.000Z", "max_issues_repo_path": "buildroot-external/package/neoserver/pkg/mediola/neo_server/node_modules/xnm.aio.zwave.js", "max_issues_repo_name": "Maik2208/RaspberryMatic", "max_issues_repo_issues_event_min_datetime": "2016-11-13T22:59:25.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T20:45:07.000Z", "max_forks_repo_path": "buildroot-external/package/neoserver/pkg/mediola/neo_server/node_modules/xnm.aio.zwave.js", "max_forks_repo_name": "alexreinert/RaspberryMatic", "max_forks_repo_forks_event_min_datetime": "2016-08-21T14:44:31.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-31T13:06:06.000Z"}
{"max_stars_count": 1096, "max_issues_count": 1437, "max_forks_count": 231, "avg_line_length": 326.1428571429, "max_line_length": 536, "alphanum_fraction": 0.7144108629}
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,c){a.raw=c;return a};var xnm=xnm||{};xnm.aio=xnm.aio||{};xnm.aio.zwave=xnm.aio.zwave||{};xnm.aio.zwave.ZWave=function(){this.ID="zwave";this.NAME="Z-Wave";this.GDT_ID="ZWAVE";this.GDT_ID2="ZWAVE2";this.CAN_BE_CONFIGURED=["37","38","49","64","67"]};
xnm.aio.zwave.ZWave.prototype.canDeviceBeConfigured=function(a){if(!this.hasKey(a,["info","dpts"]))return!1;for(var c in a.info.dpts)if(0<=this.CAN_BE_CONFIGURED.indexOf(c))return!0;return!1};
xnm.aio.zwave.ZWave.prototype.exclusion=function(a,c,f){var g="http://"+a.info.ip+":"+a.info.port+"/cmd",h={XC_FNC:"ZWaveExclusion",address:-1};this.hasKey(c,["info","address"])&&(XC.debugf("[AIO.ZWAVE.exclusion] Device given. Address: "+c.info.address),delete h.address);a.info.password&&(h.auth=a.info.password);$.ajax({cache:!1,data:h,dataType:"json",url:g,success:function(d,b,e){b=null;d.XC_ERR?(b=Error(e.responseText),XC.debugf("[AIO.ZWAVE.exclusion] "+b.message)):XC.debugf("[AIO.ZWAVE.exclusion] "+
e.responseText);f&&f(b,d)},error:function(d,b,e){d=Error(e||b);XC.debugf("[AIO.ZWAVE.exclusion] "+d.message);f&&f(d)}})};
xnm.aio.zwave.ZWave.prototype.getDeviceSettings=function(a,c,f){var g="http://"+a.info.ip+":"+a.info.port+"/cmd";c={XC_FNC:"ZWaveGetDeviceSetting",deviceID:c.info.address};a.info.password&&(c.auth=a.info.password);$.ajax({cache:!1,contentType:"application/json",data:JSON.stringify(c),dataType:"json",method:"POST",url:g,success:function(h,d,b){d=null;h.XC_ERR?(d=Error(b.responseText),XC.debugf("[AIO.ZWAVE.getDeviceSettings] "+d.message)):XC.debugf("[AIO.ZWAVE.getDeviceSettings] "+b.responseText);f&&
f(d,h.XC_SUC)},error:function(h,d,b){h=Error(b||d);XC.debugf("[AIO.ZWAVE.getDeviceSettings] "+h.message);f&&f(h)}})};
xnm.aio.zwave.ZWave.prototype.getInterviewResults=function(a,c,f){var g=this,h="http://"+a.info.ip+":"+a.info.port+"/cmd";c={XC_FNC:"ZWaveListInterviewResults",address:c.info.address};a.info.password&&(c.auth=a.info.password);$.ajax({cache:!1,data:c,dataType:"json",url:h,success:function(d,b,e){b=null;d.XC_ERR?(b=Error(e.responseText),XC.debugf("[AIO.ZWAVE.getInterviewResults] "+b.message)):XC.debugf("[AIO.ZWAVE.getInterviewResults] "+e.responseText);g.isObject(d.XC_SUC)||(b=Error("No error response, but no XC_SUC data either."));
f&&f(b,d.XC_SUC)},error:function(d,b,e){d=Error(e||b);XC.debugf("[AIO.ZWAVE.getInterviewResults] "+d.message);f&&f(d)}})};
xnm.aio.zwave.ZWave.prototype.interview=function(a,c,f,g){a="ws://"+a.info.ip+":"+a.info.port+"/zwave2/inclusion";var h={command:"start"};c&&(h.command="updateInterview",h.address=c.info.address,h.instanceID=c.info.instance,h.commandClassID=f);var d=JSON.stringify(h),b=new WebSocket(a);b.onclose=function(e,k){XC.debugf("[AIO.ZWAVE.interview] WebSocket closed. Code: "+(e+". Message: "+k+"."))};b.onerror=function(e){XC.debugf("[AIO.ZWAVE.interview] "+e.message);b.close();g&&g(e,null)};b.onopen=function(){b.send(d,
null,function(e){e?(XC.debugf("[AIO.ZWAVE.interview] "+e.message),g&&g(e,null)):XC.debugf('[AIO.ZWAVE.interview] Send command "'+h.command+'".')})};b.onmessage=function(e,k){e=e.data;k=null;try{k=JSON.parse(e)}catch(l){XC.debugf("[AIO.ZWAVE.interview] "+l.message);b.close();g&&g(l,null);return}(1===k.progress||k.finish)&&XC.debugf("[AIO.ZWAVE.interview] "+e);k.finish&&b.close();g&&g(null,k)}};
xnm.aio.zwave.ZWave.prototype.setDeviceSettings=function(a,c,f,g){var h="http://"+a.info.ip+":"+a.info.port+"/cmd";c={XC_FNC:"ZWaveSetDeviceSetting",deviceID:c.info.address,setting:f};a.info.password&&(c.auth=a.info.password);$.ajax({cache:!1,contentType:"application/json",data:JSON.stringify(c),dataType:"json",method:"POST",url:h,success:function(d,b,e){b=null;d.XC_ERR?(b=Error(e.responseText),Log.error("[AIO.ZWAVE.setDeviceSettings] "+b.message)):Log.debug("[AIO.ZWAVE.setDeviceSettings] "+e.responseText);
g&&g(b,d.XC_SUC)},error:function(d,b,e){d=Error(e||b);Log.error("[AIO.ZWAVE.setDeviceSettings] "+d.message);g&&g(d)}})};xnm.aio.zwave.ZWave.prototype.isObject=function(a){return"object"===typeof a&&null!==a};xnm.aio.zwave.ZWave.prototype.hasKey=function(a,c){if(null===a||"object"!==typeof a||!c)return!1;Array.isArray(c)||(c=[c]);for(var f=0;f<c.length;f++){var g=c[f];if("object"===typeof a&&null!==a&&"undefined"!==typeof a[g])a=a[g];else return!1}return!0};xnm.aio.zwave.Handler=xnm.aio.zwave.ZWave;
"undefined"!=typeof exports&&"undefined"!=typeof module&&module.exports&&(exports=module.exports=new xnm.aio.zwave.Handler);
