rfcontroljs
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -1,6 +0,7 @@ | ||
var doesProtocolMatch, helper, protocols, sortIndices; | ||
var doesProtocolMatch, helper, protocols, sortIndices, | ||
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | ||
helper = require('./helper'); | ||
protocols = ['weather1', 'weather2', 'weather3', 'switch1', 'switch2', 'switch3', 'switch4', 'pir1', 'generic']; | ||
protocols = ['weather1', 'weather2', 'weather3', 'switch1', 'switch2', 'switch3', 'switch4', "switch5", 'pir1', 'contact1', 'generic']; | ||
@@ -14,5 +15,11 @@ protocols = protocols.map((function(_this) { | ||
doesProtocolMatch = function(pulseLengths, pulses, protocol) { | ||
var i, maxDelta; | ||
if (pulses.length !== protocol.pulseCount) { | ||
return false; | ||
var i, maxDelta, _ref; | ||
if (protocol.pulseCounts != null) { | ||
if (_ref = pulses.length, __indexOf.call(protocol.pulseCounts, _ref) < 0) { | ||
return false; | ||
} | ||
} else { | ||
if (pulses.length !== protocol.pulseCount) { | ||
return false; | ||
} | ||
} | ||
@@ -19,0 +26,0 @@ if (pulseLengths.length !== protocol.pulseLengths.length) { |
{ | ||
"name": "rfcontroljs", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "Protocol support for different 433mhz switches and weather stations for the RFControl Arduino library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
78652
20
788