homey-lib
Advanced tools
Comparing version 1.0.41 to 1.0.42
@@ -40,7 +40,7 @@ "use strict"; | ||
*/ | ||
App.prototype.getAllowedLocales = function(){ | ||
return allowedLocales; | ||
} | ||
App.prototype.getAllowedCategories = function(){ | ||
@@ -243,3 +243,3 @@ return allowedCategories; | ||
for( var image in json.images ) { | ||
var image_value = json.images[image]; | ||
@@ -252,3 +252,3 @@ var image_path = path.join( this.app_path, image_value ); | ||
} | ||
if( !fileExistsSyncCaseSensitive( image_path ) ) { | ||
@@ -258,3 +258,3 @@ error("`images." + image + "` file (" + image_value + ") does not exist"); | ||
} | ||
var imageBuf = fs.readFileSync( image_path ); | ||
@@ -268,3 +268,3 @@ if( | ||
} | ||
try { | ||
@@ -279,3 +279,3 @@ var image_size = sizeOf( image_path ); | ||
error("`images." + image + "` has invalid dimensions (" + image_size.width + "x" + image_size.height + "), must be 250x175"); | ||
} catch( err ) { | ||
@@ -339,6 +339,6 @@ console.error('Warning:', err, image_path); | ||
if( setting.type === 'group' ) { | ||
if( typeof setting.children == 'undefined' ) | ||
return error("missing `driver[" + i + "].settings" + path + "[" + j + "].children` in app.json"); | ||
if( !Array.isArray(setting.children) ) | ||
@@ -382,9 +382,9 @@ return error("`driver[" + i + "].settings" + path + "[" + j + "].children` in app.json is not an Array."); | ||
if( !driver.images.large ) | ||
error("missing `drivers[" + i + "].images.large` in app.json"); | ||
error("missing `drivers[" + driver.id + "].images.large` in app.json"); | ||
if( !driver.images.small ) | ||
error("missing `drivers[" + i + "].images.small` in app.json"); | ||
error("missing `drivers[" + driver.id + "].images.small` in app.json"); | ||
for( var image in driver.images ) { | ||
var image_value = driver.images[image]; | ||
@@ -394,11 +394,11 @@ var image_path = path.join( this.app_path, image_value ); | ||
if( image_ext != '.jpg' && image_ext != '.png' ) { | ||
error("drivers[" + i + "].images." + image + " file (" + image_value + ") is not a .jpg or .png file"); | ||
error("drivers[" + driver.id + "].images." + image + " file (" + image_value + ") is not a .jpg or .png file"); | ||
continue; | ||
} | ||
if( !fileExistsSyncCaseSensitive( image_path ) ) { | ||
error("`images." + image + "` file (" + image_value + ") does not exist"); | ||
error("`drivers[" + driver.id + "].images." + image + "` file (" + image_value + ") does not exist"); | ||
continue; | ||
} | ||
var imageBuf = fs.readFileSync( image_path ); | ||
@@ -409,6 +409,6 @@ if( | ||
) { | ||
error("`images." + image + "` has invalid contents, expected " + image_ext.substring(1)); | ||
error("`drivers[" + driver.id + "].images." + image + "` has invalid contents, expected " + image_ext.substring(1)); | ||
continue; | ||
} | ||
try { | ||
@@ -418,7 +418,7 @@ var image_size = sizeOf( image_path ); | ||
if( image == 'large' && ( image_size.width != 500 || image_size.height != 500 ) ) | ||
error("`drivers[" + i + "].images." + image + "` has invalid dimensions (" + image_size.width + "x" + image_size.height + "), must be 500x500"); | ||
error("`drivers[" + driver.id + "].images." + image + "` has invalid dimensions (" + image_size.width + "x" + image_size.height + "), must be 500x500"); | ||
if( image == 'small' && ( image_size.width != 75 || image_size.height != 75 ) ) | ||
error("`drivers[" + i + "].images." + image + "` has invalid dimensions (" + image_size.width + "x" + image_size.height + "), must be 75x75"); | ||
error("`drivers[" + driver.id + "].images." + image + "` has invalid dimensions (" + image_size.width + "x" + image_size.height + "), must be 75x75"); | ||
} catch( err ) { | ||
@@ -429,3 +429,3 @@ console.error('Warning:', err, image_path); | ||
} else if( lvl_publish ) { | ||
error("missing `drivers[" + i + "].images` in app.json"); | ||
error("missing `drivers[" + driver.id + "].images` in app.json"); | ||
} | ||
@@ -438,13 +438,13 @@ | ||
if( !(gtin.length === 8 || gtin.length === 12 || gtin.length === 13 || gtin.length === 14) ) | ||
error("invalid `drivers[" + i + "].gtin[" + j + "]` length in app.json"); | ||
error("invalid `drivers[" + driver.id + "].gtin[" + j + "]` length in app.json"); | ||
if( !isNumeric(gtin) ) | ||
error("invalid `drivers[" + i + "].gtin[" + j + "]` (non-numeric) in app.json"); | ||
error("invalid `drivers[" + driver.id + "].gtin[" + j + "]` (non-numeric) in app.json"); | ||
} else { | ||
error("invalid `drivers[" + i + "].gtin[" + j + "]` type in app.json"); | ||
error("invalid `drivers[" + driver.id + "].gtin[" + j + "]` type in app.json"); | ||
} | ||
}); | ||
} else { | ||
error("invalid `drivers[" + i + "].gtin` in app.json"); | ||
error("invalid `drivers[" + driver.id + "].gtin` in app.json"); | ||
} | ||
@@ -451,0 +451,0 @@ } |
@@ -23,4 +23,4 @@ { | ||
"homey:wireless:433": { | ||
"en": "Send and receive on the 434 MHz frequency", | ||
"nl": "Verzenden en ontvangen op de 434 MHz frequentie" | ||
"en": "Send and receive on the 433 MHz frequency", | ||
"nl": "Verzenden en ontvangen op de 433 MHz frequentie" | ||
}, | ||
@@ -27,0 +27,0 @@ "homey:wireless:868": { |
{ | ||
"name": "homey-lib", | ||
"version": "1.0.41", | ||
"version": "1.0.42", | ||
"description": "Library for Homey", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
119056