homey-lib
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -8,3 +8,3 @@ var lib = require('..'); | ||
var app = new lib.App( process.argv[2] ); | ||
var result = app.validate( true ); // true = check for app store | ||
var result = app.validate( ( process.argv[3] == '--validate-app-store' ) || false ); // true = check for app store | ||
@@ -11,0 +11,0 @@ if( result.success ) { |
@@ -121,2 +121,7 @@ var fs = require('fs'); | ||
error("invalid category `" + json.category + "` in app.json. Allowed categories: [" + categories.join(', ') + "]"); | ||
} else if( lvl_publish && Array.isArray(json.category) ) { | ||
json.category.forEach(function(category, i){ | ||
if( categories.indexOf(category) < 0 ) | ||
error("invalid category `" + category + "` in app.json. Allowed categories: [" + categories.join(', ') + "]"); | ||
}); | ||
} else if( lvl_publish ) { | ||
@@ -317,18 +322,22 @@ error("missing `category` in app.json"); | ||
if( typeof trigger.id == 'undefined' ) | ||
if( typeof trigger.id == 'undefined' ) { | ||
error("missing `speech[" + i + "].id` in app.json") | ||
} | ||
if( typeof trigger.importance != 'number' ) | ||
error("invalid `speech[" + i + "].importance` in app.json, must be of type number") | ||
if( typeof trigger.importance == 'number' ) { | ||
if( trigger.importance < 0 || trigger.importance > 1 ) | ||
if( trigger.importance < 0 || trigger.importance > 1 ) { | ||
error("`speech[" + i + "].importance` is out of range [0-1]") | ||
} | ||
} else if( trigger.importance !== false ) { | ||
error("`speech[" + i + "].importance` not a number, or boolean false"); | ||
} | ||
if( typeof trigger.triggers == 'undefined' ) | ||
if( typeof trigger.triggers == 'undefined' ) { | ||
error("missing `speech[" + i + "].triggers` in app.json") | ||
} | ||
if( typeof trigger.triggers == 'object' ) | ||
if( !Array.isArray(trigger.triggers.en) ) | ||
if( typeof trigger.triggers == 'object' ) { | ||
if( !Array.isArray(trigger.triggers.en) ) { | ||
error("missing `speech[" + i + "].triggers.en` in app.json") | ||
} | ||
} | ||
@@ -335,0 +344,0 @@ |
{ | ||
"name": "homey-lib", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Library for Homey", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
65088
367