Skip to content

Commit

Permalink
Added Unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
datech committed Mar 5, 2020
1 parent c6cc532 commit 470c40f
Show file tree
Hide file tree
Showing 7 changed files with 2,131 additions and 8 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ module.exports = function(RED) {
address: req.hostname,
username: req.params.username,
date: new Date().toISOString().split('.').shift(),
uniqueid: function () {
uniqueid: function() {
return hueUniqueId(this.id);
}
}
Expand All @@ -225,7 +225,7 @@ module.exports = function(RED) {
var data = {
lights: getDevicesAttributes(hubNode.context()),
date: new Date().toISOString().split('.').shift(),
uniqueid: function () {
uniqueid: function() {
return hueUniqueId(this.id);
}
}
Expand Down Expand Up @@ -340,7 +340,7 @@ module.exports = function(RED) {
}

function hueUniqueId(id) {
return (id + '0000').replace(/(.{2})/g,"$1:").substring(0, 23) + '-00';
return (id + '0000').replace(/(.{2})/g, "$1:").substring(0, 23) + '-00';
}

function getHueHubId(config) {
Expand Down
Loading

0 comments on commit 470c40f

Please sign in to comment.