homey-lib
Advanced tools
Comparing version 2.2.3 to 2.2.4
@@ -192,2 +192,24 @@ 'use strict'; | ||
} | ||
if (driver.zwave) { | ||
for (let j = 0; j < driver.settings.length; j++) { | ||
let setting = driver.settings[j]; | ||
if (setting.zwave && settings.attr && settings.attr.max) { | ||
let signed; | ||
let size = setting.zwave.size; | ||
let max = setting.attr.max; | ||
if (typeof setting.zwave.signed === 'boolean') { | ||
signed = setting.zwave.signed; | ||
} else { | ||
signed = true; | ||
} | ||
if (size === 1 && max > 127 && max < 255 && signed || | ||
size === 2 && max > 32767 && max < 65535 && signed || | ||
size === 4 && max > 2147483647 && max < 4294967295 && signed) | ||
throw new Error(`Value cannot be signed: ${driver}, ${setting}`); | ||
} | ||
} | ||
} | ||
@@ -194,0 +216,0 @@ // validate `appJson.drivers[].images` |
{ | ||
"name": "homey-lib", | ||
"version": "2.2.3", | ||
"version": "2.2.4", | ||
"description": "Shared Library for Homey", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
138684
2935