@iobroker/legacy-testing 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/setup.js +2 -2
package/README.md CHANGED
@@ -11,7 +11,7 @@ Legacy test modules for ioBroker
11
11
 
12
12
  ## Changelog
13
13
  <!-- ### **WORK IN PROGRESS** -->
14
- ### 0.3.1 (2023-05-08)
14
+ ### 0.3.3 (2023-05-08)
15
15
  * (bluefox) Added possibility to install additional adapters at start
16
16
  * (bluefox) Added setOfflineState/getOfflineState
17
17
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.1",
2
+ "version": "0.3.3",
3
3
  "name": "@iobroker/legacy-testing",
4
4
  "main": "setup.js",
5
5
  "files": [
package/setup.js CHANGED
@@ -294,7 +294,6 @@ async function installAdapter(customAdapterName, cb) {
294
294
  console.warn(`[${customAdapterName}] Adapter not installed: ${err}`);
295
295
  // try workaround
296
296
  installCustomAdapter(customAdapterName);
297
- const startFile = `node_modules/${appName}.js-controller/${appName}.js`;
298
297
  // make first install
299
298
  if (debug) {
300
299
  cp.execSync(`node ${startFile} add ${customAdapterName} --enabled false`, {
@@ -665,7 +664,7 @@ function startAdapter(objects, states, callback) {
665
664
 
666
665
  function startCustomAdapter(adapterName, adapterInstance) {
667
666
  adapterInstance = adapterInstance || 0;
668
- const id = `${adapterName || pkg.name}.${adapterInstance}`;
667
+ const id = `${adapterName || pkg.name.split('.')[1]}.${adapterInstance}`;
669
668
  if (adaptersStarted[id]) {
670
669
  console.log(`Adapter ${id} already started ...`);
671
670
  return;
@@ -673,6 +672,7 @@ function startCustomAdapter(adapterName, adapterInstance) {
673
672
  adaptersStarted[id] = true;
674
673
  console.log(`startAdapter ${id} ...`);
675
674
  const _pkg = adapterName ? require(`${rootDir}tmp/node_modules/iobroker.${adapterName}/package.json`) : pkg;
675
+ adapterName = adapterName || pkg.name.split('.')[1];
676
676
  if (fs.existsSync(`${rootDir}tmp/node_modules/iobroker.${adapterName}/${_pkg.main || 'main.js'}`)) {
677
677
  try {
678
678
  if (debug) {