File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 1717 "options" : {
1818 "default" : {
1919 "persistPropertyValues" : false ,
20- "randomizePropertyValues" : false
20+ "randomizePropertyValues" : false ,
21+ "excludeDefaultThings" : false
2122 },
2223 "schema" : {
2324 "type" : " object" ,
2425 "required" : [
2526 " persistPropertyValues" ,
26- " randomizePropertyValues"
27+ " randomizePropertyValues" ,
28+ " excludeDefaultThings"
2729 ],
2830 "properties" : {
2931 "persistPropertyValues" : {
3436 "description" : " Whether or not to periodically generate new property values" ,
3537 "type" : " boolean"
3638 },
39+ "excludeDefaultThings" : {
40+ "description" : " Whether or not to exclude the default virtual things" ,
41+ "type" : " boolean"
42+ },
3743 "customThings" : {
3844 "description" : " Custom virtual things to create" ,
3945 "type" : " array" ,
Original file line number Diff line number Diff line change @@ -1505,10 +1505,12 @@ class VirtualThingsAdapter extends Adapter {
15051505 }
15061506
15071507 addAllThings ( ) {
1508- for ( let i = 0 ; i < VIRTUAL_THINGS . length ; i ++ ) {
1509- const id = `virtual-things-${ i } ` ;
1510- if ( ! this . devices [ id ] ) {
1511- new VirtualThingsDevice ( this , id , VIRTUAL_THINGS [ i ] ) ;
1508+ if ( ! this . config . excludeDefaultThings ) {
1509+ for ( let i = 0 ; i < VIRTUAL_THINGS . length ; i ++ ) {
1510+ const id = `virtual-things-${ i } ` ;
1511+ if ( ! this . devices [ id ] ) {
1512+ new VirtualThingsDevice ( this , id , VIRTUAL_THINGS [ i ] ) ;
1513+ }
15121514 }
15131515 }
15141516
You can’t perform that action at this time.
0 commit comments