Skip to content

Commit f97d173

Browse files
committed
Check and validate location slot value exists
1 parent 137a828 commit f97d173

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

helper.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,16 @@ function getModeName(modeType,modeId) {
7878
return false;
7979
}
8080

81+
function checkLocation(location) {
82+
//console.log('result of checkLocation for ' + location + ' is: ' + config.HA_locations.indexOf(location) > -1);
83+
return config.HA_locations.indexOf(location) > -1;
84+
}
85+
8186
// Exports
8287
module.exports.getItem = getItem;
8388
module.exports.getMetric = getMetric;
8489
module.exports.getUnit = getUnit;
8590
module.exports.getColor = getColor;
8691
module.exports.getMode = getMode;
87-
module.exports.getModeName = getModeName;
92+
module.exports.getModeName = getModeName;
93+
module.exports.checkLocation = checkLocation;

0 commit comments

Comments
 (0)