@@ -1515,10 +1515,12 @@ class VirtualThingsAdapter extends Adapter {
15151515 }
15161516
15171517 addAllThings ( ) {
1518- for ( let i = 0 ; i < VIRTUAL_THINGS . length ; i ++ ) {
1519- const id = `virtual-things-${ i } ` ;
1520- if ( ! this . devices [ id ] ) {
1521- new VirtualThingsDevice ( this , id , VIRTUAL_THINGS [ i ] ) ;
1518+ if ( ! this . config . excludeDefaultThings ) {
1519+ for ( let i = 0 ; i < VIRTUAL_THINGS . length ; i ++ ) {
1520+ const id = `virtual-things-${ i } ` ;
1521+ if ( ! this . devices [ id ] ) {
1522+ new VirtualThingsDevice ( this , id , VIRTUAL_THINGS [ i ] ) ;
1523+ }
15221524 }
15231525 }
15241526
@@ -1533,8 +1535,10 @@ class VirtualThingsAdapter extends Adapter {
15331535 continue ;
15341536 }
15351537
1536- descr . properties = descr . properties || [ ] ;
1537- for ( const property of descr . properties ) {
1538+ const properties = ( descr . properties || [ ] ) . map ( ( property ) => {
1539+ return Object . assign ( { } , property ) ;
1540+ } ) ;
1541+ for ( const property of properties ) {
15381542 // Clean up properties
15391543 if ( ! [ 'number' , 'integer' ] . includes ( property . type ) ) {
15401544 delete property . unit ;
@@ -1576,7 +1580,7 @@ class VirtualThingsAdapter extends Adapter {
15761580 break ;
15771581 case 'string' :
15781582 // just in case
1579- property . default = `${ property . default } ` ;
1583+ property . default = `${ property . default || '' } ` ;
15801584 break ;
15811585 }
15821586 }
@@ -1602,7 +1606,7 @@ class VirtualThingsAdapter extends Adapter {
16021606 events : [ ] ,
16031607 } ;
16041608
1605- for ( const property of descr . properties ) {
1609+ for ( const property of properties ) {
16061610 const prop = {
16071611 name : property . name ,
16081612 value : property . default ,
0 commit comments