@cldmv/node-android-tv-remote 1.5.3 → 1.5.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cldmv/node-android-tv-remote",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "description": "A Node.js library for controlling Android TV devices via ADB keycodes and text input.",
5
5
  "main": "src/lib/android-tv-remote.js",
6
6
  "scripts": {
File without changes
@@ -103,6 +103,7 @@ function handleDisconnectError(err) {
103
103
  errorWithTime(
104
104
  "Tip: In Developer Options on your TV, try toggling 'ADB Debugging' off and then back on. This often resolves authentication issues."
105
105
  );
106
+ process.exit(1);
106
107
  }
107
108
  if (err.message && (err.message.includes("actively refused") || err.message.includes("No connection could be made"))) {
108
109
  errorWithTime("\nThe device refused the connection. To enable ADB, follow these steps on your Android TV or Fire TV:");
@@ -114,8 +115,9 @@ function handleDisconnectError(err) {
114
115
  errorWithTime("6. On your computer, run: adb connect <device-ip>:5555");
115
116
  errorWithTime("7. Accept the authorization prompt on your TV");
116
117
  errorWithTime("\nIf you do not see 'Developer Options', repeat step 2 until it appears.");
118
+ process.exit(1);
117
119
  }
118
- process.exit(1);
120
+ return err;
119
121
  }
120
122
 
121
123
  /**
@@ -284,9 +286,9 @@ module.exports = function (config) {
284
286
  if (!quiet) warnWithTime("Warning: Device already connected.");
285
287
  connected = true;
286
288
  startHeartbeat();
287
- return;
289
+ return true;
288
290
  }
289
- handleDisconnectError(err);
291
+ return handleDisconnectError(err);
290
292
  });
291
293
  }
292
294
  const connectWrapped = wrapAsync(connect);
@@ -308,14 +310,15 @@ module.exports = function (config) {
308
310
  .then(function () {
309
311
  connected = false;
310
312
  if (!quiet) logWithTime("Disconnected from " + host);
313
+ return true;
311
314
  })
312
315
  .catch(function (err) {
313
316
  if (err.message && err.message.includes("disconnected")) {
314
317
  if (!quiet) warnWithTime("Warning: Device already disconnected before explicit disconnect call.");
315
318
  connected = false;
316
- return;
319
+ return true;
317
320
  }
318
- handleDisconnectError(err);
321
+ return handleDisconnectError(err);
319
322
  });
320
323
  }
321
324
  const disconnectWrapped = wrapAsync(disconnect);
@@ -557,7 +560,7 @@ module.exports = function (config) {
557
560
  if (err.message && err.message.includes("disconnected")) {
558
561
  if (!useQuiet) warnWithTime("Warning: Device already disconnected before explicit disconnect call.");
559
562
  } else {
560
- handleDisconnectError(err);
563
+ return handleDisconnectError(err);
561
564
  }
562
565
  });
563
566
  },