node-red-contrib-deconz
Advanced tools
Comparing version 0.10.3 to 0.10.4
@@ -89,2 +89,10 @@ module.exports = function(RED) { | ||
//outputs | ||
if ( node.config.state in device.state && node.config.output == 'onchange' && device.state[node.config.state] == node.oldState ) { | ||
return; | ||
} | ||
if ( node.config.state in device.state && node.config.output == 'onupdate' && device.state['lastupdated'] == node.prevUpdateTime ) { | ||
return; | ||
} | ||
node.oldState = device.state[node.config.state]; | ||
node.prevUpdateTime = device.state['lastupdated']; | ||
node.send([ | ||
@@ -91,0 +99,0 @@ { |
@@ -41,3 +41,3 @@ { | ||
}, | ||
"version": "0.10.3" | ||
"version": "0.10.4" | ||
} |
@@ -119,3 +119,3 @@ function deconz_gatewayScanner(nodeItem, selectedItemElementName, options = {}) { | ||
var sHTML = selectItemSpanElement.html(); | ||
selectItemSpanElement.html(truncateWithEllipses(sHTML, 35)); | ||
selectItemSpanElement.html(deconz_truncateWithEllipses(sHTML, 35)); | ||
} catch (error) { | ||
@@ -211,3 +211,3 @@ console.error('Error #4534'); | ||
var sHTML = selectItemSpanElement.html(); | ||
selectItemSpanElement.html(truncateWithEllipses(sHTML, 35)); | ||
selectItemSpanElement.html(deconz_truncateWithEllipses(sHTML, 35)); | ||
@@ -389,1 +389,16 @@ } catch (error) { | ||
} | ||
/** | ||
* truncateWithEllipses | ||
* | ||
* Utility function to truncate long strings with elipsis ('...') | ||
* | ||
*/ | ||
function deconz_truncateWithEllipses(text, max = 30) { | ||
if (text) { | ||
return text.substr(0, max - 1) + (text.length > max ? '…' : ''); | ||
} else { | ||
return text; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
767140
2745