-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add node-uuid module Change logger code to generate more clean Homey Logger lines
- Loading branch information
Inversion-NL
committed
Jan 24, 2017
1 parent
ce8d397
commit 77d9b46
Showing
19 changed files
with
1,856 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var util = require('./util.js'); | ||
|
||
const severity = util.severity; | ||
|
||
/** | ||
* Helper function to parse float from a string | ||
* @param data | ||
* @returns {*} Returns 0 if unable to parse, otherwise the parsed floating value | ||
*/ | ||
exports.parseWeatherFloat = function (data){ | ||
var temp = parseFloat(data); | ||
if (isNaN(temp)) return 0; | ||
else return temp; | ||
}; | ||
|
||
/** | ||
* Helper function to test weather data | ||
* @param data Data to test | ||
* @returns {object} returns the weather object or a empty string the data was null or undefined | ||
*/ | ||
exports.testWeatherData = function (data) { | ||
if (!util.value_exist(data)) { | ||
util.wuLog('Test weather data: Value was undefined or null, returning empty string', severity.debug); | ||
return ""; | ||
} | ||
else return data; | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.