@sebbo2002/node-pyatv 4.3.0-develop.2 → 4.3.0-develop.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.
- package/CHANGELOG.md +7 -0
- package/dist/lib/device.js +26 -23
- package/dist/lib/device.js.map +1 -1
- package/docs/coverage/cobertura-coverage.xml +91 -90
- package/docs/coverage/device-event.ts.html +1 -1
- package/docs/coverage/device-events.ts.html +1 -1
- package/docs/coverage/device.ts.html +43 -31
- package/docs/coverage/fake-spawn.ts.html +1 -1
- package/docs/coverage/index.html +12 -12
- package/docs/coverage/index.ts.html +1 -1
- package/docs/coverage/instance.ts.html +1 -1
- package/docs/coverage/tools.ts.html +4 -4
- package/docs/coverage/types.ts.html +1 -1
- package/docs/reference/classes/NodePyATVDevice.html +60 -60
- package/docs/reference/classes/NodePyATVDeviceEvent.html +5 -5
- package/docs/reference/classes/default.html +10 -10
- package/docs/reference/enums/NodePyATVDeviceState.html +1 -1
- package/docs/reference/enums/NodePyATVKeys.html +1 -1
- package/docs/reference/enums/NodePyATVListenerState.html +1 -1
- package/docs/reference/enums/NodePyATVMediaType.html +1 -1
- package/docs/reference/enums/NodePyATVPowerState.html +1 -1
- package/docs/reference/enums/NodePyATVProtocol.html +1 -1
- package/docs/reference/enums/NodePyATVRepeatState.html +1 -1
- package/docs/reference/enums/NodePyATVShuffleState.html +1 -1
- package/docs/reference/index.html +1 -1
- package/docs/reference/interfaces/NodePyATVDeviceOptions.html +1 -1
- package/docs/reference/interfaces/NodePyATVFindAndInstanceOptions.html +1 -1
- package/docs/reference/interfaces/NodePyATVFindOptions.html +1 -1
- package/docs/reference/interfaces/NodePyATVGetStateOptions.html +1 -1
- package/docs/reference/interfaces/NodePyATVInstanceOptions.html +1 -1
- package/docs/reference/interfaces/NodePyATVState.html +1 -1
- package/docs/reference/interfaces/NodePyATVVersionResponse.html +1 -1
- package/docs/reference/modules.html +1 -1
- package/docs/tests/index.html +1 -1
- package/docs/tests/mochawesome.json +609 -609
- package/package.json +1 -1
- package/src/lib/device.ts +27 -23
package/package.json
CHANGED
package/src/lib/device.ts
CHANGED
|
@@ -316,7 +316,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
316
316
|
return state.appId;
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
-
private async _pressKey(key: NodePyATVInternalKeys, executableType
|
|
319
|
+
private async _pressKey(key: NodePyATVInternalKeys, executableType: NodePyATVExecutableType) {
|
|
320
320
|
const id = addRequestId();
|
|
321
321
|
const parameters = getParamters(this.options);
|
|
322
322
|
|
|
@@ -356,7 +356,11 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
const internalKey = internalKeyEntry[1];
|
|
359
|
-
|
|
359
|
+
const executableType = [NodePyATVKeys.turnOn, NodePyATVKeys.turnOff].includes(key) ?
|
|
360
|
+
NodePyATVExecutableType.atvremote :
|
|
361
|
+
NodePyATVExecutableType.atvscript;
|
|
362
|
+
|
|
363
|
+
await this._pressKey(internalKey, executableType);
|
|
360
364
|
}
|
|
361
365
|
|
|
362
366
|
/**
|
|
@@ -364,7 +368,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
364
368
|
* @category Control
|
|
365
369
|
*/
|
|
366
370
|
async down(): Promise<void> {
|
|
367
|
-
await this._pressKey(NodePyATVInternalKeys.down);
|
|
371
|
+
await this._pressKey(NodePyATVInternalKeys.down, NodePyATVExecutableType.atvscript);
|
|
368
372
|
}
|
|
369
373
|
|
|
370
374
|
/**
|
|
@@ -372,7 +376,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
372
376
|
* @category Control
|
|
373
377
|
*/
|
|
374
378
|
async home(): Promise<void> {
|
|
375
|
-
await this._pressKey(NodePyATVInternalKeys.home);
|
|
379
|
+
await this._pressKey(NodePyATVInternalKeys.home, NodePyATVExecutableType.atvscript);
|
|
376
380
|
}
|
|
377
381
|
|
|
378
382
|
/**
|
|
@@ -380,7 +384,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
380
384
|
* @category Control
|
|
381
385
|
*/
|
|
382
386
|
async homeHold(): Promise<void> {
|
|
383
|
-
await this._pressKey(NodePyATVInternalKeys.homeHold);
|
|
387
|
+
await this._pressKey(NodePyATVInternalKeys.homeHold, NodePyATVExecutableType.atvscript);
|
|
384
388
|
}
|
|
385
389
|
|
|
386
390
|
/**
|
|
@@ -388,7 +392,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
388
392
|
* @category Control
|
|
389
393
|
*/
|
|
390
394
|
async left(): Promise<void> {
|
|
391
|
-
await this._pressKey(NodePyATVInternalKeys.left);
|
|
395
|
+
await this._pressKey(NodePyATVInternalKeys.left, NodePyATVExecutableType.atvscript);
|
|
392
396
|
}
|
|
393
397
|
|
|
394
398
|
/**
|
|
@@ -396,7 +400,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
396
400
|
* @category Control
|
|
397
401
|
*/
|
|
398
402
|
async menu(): Promise<void> {
|
|
399
|
-
await this._pressKey(NodePyATVInternalKeys.menu);
|
|
403
|
+
await this._pressKey(NodePyATVInternalKeys.menu, NodePyATVExecutableType.atvscript);
|
|
400
404
|
}
|
|
401
405
|
|
|
402
406
|
/**
|
|
@@ -404,7 +408,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
404
408
|
* @category Control
|
|
405
409
|
*/
|
|
406
410
|
async next(): Promise<void> {
|
|
407
|
-
await this._pressKey(NodePyATVInternalKeys.next);
|
|
411
|
+
await this._pressKey(NodePyATVInternalKeys.next, NodePyATVExecutableType.atvscript);
|
|
408
412
|
}
|
|
409
413
|
|
|
410
414
|
/**
|
|
@@ -412,7 +416,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
412
416
|
* @category Control
|
|
413
417
|
*/
|
|
414
418
|
async pause(): Promise<void> {
|
|
415
|
-
await this._pressKey(NodePyATVInternalKeys.pause);
|
|
419
|
+
await this._pressKey(NodePyATVInternalKeys.pause, NodePyATVExecutableType.atvscript);
|
|
416
420
|
}
|
|
417
421
|
|
|
418
422
|
/**
|
|
@@ -420,7 +424,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
420
424
|
* @category Control
|
|
421
425
|
*/
|
|
422
426
|
async play(): Promise<void> {
|
|
423
|
-
await this._pressKey(NodePyATVInternalKeys.play);
|
|
427
|
+
await this._pressKey(NodePyATVInternalKeys.play, NodePyATVExecutableType.atvscript);
|
|
424
428
|
}
|
|
425
429
|
|
|
426
430
|
/**
|
|
@@ -428,7 +432,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
428
432
|
* @category Control
|
|
429
433
|
*/
|
|
430
434
|
async playPause(): Promise<void> {
|
|
431
|
-
await this._pressKey(NodePyATVInternalKeys.playPause);
|
|
435
|
+
await this._pressKey(NodePyATVInternalKeys.playPause, NodePyATVExecutableType.atvscript);
|
|
432
436
|
}
|
|
433
437
|
|
|
434
438
|
/**
|
|
@@ -436,7 +440,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
436
440
|
* @category Control
|
|
437
441
|
*/
|
|
438
442
|
async previous(): Promise<void> {
|
|
439
|
-
await this._pressKey(NodePyATVInternalKeys.previous);
|
|
443
|
+
await this._pressKey(NodePyATVInternalKeys.previous, NodePyATVExecutableType.atvscript);
|
|
440
444
|
}
|
|
441
445
|
|
|
442
446
|
/**
|
|
@@ -444,7 +448,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
444
448
|
* @category Control
|
|
445
449
|
*/
|
|
446
450
|
async right(): Promise<void> {
|
|
447
|
-
await this._pressKey(NodePyATVInternalKeys.right);
|
|
451
|
+
await this._pressKey(NodePyATVInternalKeys.right, NodePyATVExecutableType.atvscript);
|
|
448
452
|
}
|
|
449
453
|
|
|
450
454
|
/**
|
|
@@ -452,7 +456,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
452
456
|
* @category Control
|
|
453
457
|
*/
|
|
454
458
|
async select(): Promise<void> {
|
|
455
|
-
await this._pressKey(NodePyATVInternalKeys.select);
|
|
459
|
+
await this._pressKey(NodePyATVInternalKeys.select, NodePyATVExecutableType.atvscript);
|
|
456
460
|
}
|
|
457
461
|
|
|
458
462
|
/**
|
|
@@ -460,7 +464,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
460
464
|
* @category Control
|
|
461
465
|
*/
|
|
462
466
|
async skipBackward(): Promise<void> {
|
|
463
|
-
await this._pressKey(NodePyATVInternalKeys.skipBackward);
|
|
467
|
+
await this._pressKey(NodePyATVInternalKeys.skipBackward, NodePyATVExecutableType.atvscript);
|
|
464
468
|
}
|
|
465
469
|
|
|
466
470
|
/**
|
|
@@ -468,7 +472,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
468
472
|
* @category Control
|
|
469
473
|
*/
|
|
470
474
|
async skipForward(): Promise<void> {
|
|
471
|
-
await this._pressKey(NodePyATVInternalKeys.skipForward);
|
|
475
|
+
await this._pressKey(NodePyATVInternalKeys.skipForward, NodePyATVExecutableType.atvscript);
|
|
472
476
|
}
|
|
473
477
|
|
|
474
478
|
/**
|
|
@@ -476,7 +480,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
476
480
|
* @category Control
|
|
477
481
|
*/
|
|
478
482
|
async stop(): Promise<void> {
|
|
479
|
-
await this._pressKey(NodePyATVInternalKeys.stop);
|
|
483
|
+
await this._pressKey(NodePyATVInternalKeys.stop, NodePyATVExecutableType.atvscript);
|
|
480
484
|
}
|
|
481
485
|
|
|
482
486
|
/**
|
|
@@ -485,7 +489,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
485
489
|
* @deprecated
|
|
486
490
|
*/
|
|
487
491
|
async suspend(): Promise<void> {
|
|
488
|
-
await this._pressKey(NodePyATVInternalKeys.suspend);
|
|
492
|
+
await this._pressKey(NodePyATVInternalKeys.suspend, NodePyATVExecutableType.atvscript);
|
|
489
493
|
}
|
|
490
494
|
|
|
491
495
|
/**
|
|
@@ -493,7 +497,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
493
497
|
* @category Control
|
|
494
498
|
*/
|
|
495
499
|
async topMenu(): Promise<void> {
|
|
496
|
-
await this._pressKey(NodePyATVInternalKeys.topMenu);
|
|
500
|
+
await this._pressKey(NodePyATVInternalKeys.topMenu, NodePyATVExecutableType.atvscript);
|
|
497
501
|
}
|
|
498
502
|
|
|
499
503
|
/**
|
|
@@ -501,7 +505,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
501
505
|
* @category Control
|
|
502
506
|
*/
|
|
503
507
|
async up(): Promise<void> {
|
|
504
|
-
await this._pressKey(NodePyATVInternalKeys.up);
|
|
508
|
+
await this._pressKey(NodePyATVInternalKeys.up, NodePyATVExecutableType.atvscript);
|
|
505
509
|
}
|
|
506
510
|
|
|
507
511
|
/**
|
|
@@ -509,7 +513,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
509
513
|
* @category Control
|
|
510
514
|
*/
|
|
511
515
|
async volumeDown(): Promise<void> {
|
|
512
|
-
await this._pressKey(NodePyATVInternalKeys.volumeDown);
|
|
516
|
+
await this._pressKey(NodePyATVInternalKeys.volumeDown, NodePyATVExecutableType.atvscript);
|
|
513
517
|
}
|
|
514
518
|
|
|
515
519
|
/**
|
|
@@ -517,7 +521,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
517
521
|
* @category Control
|
|
518
522
|
*/
|
|
519
523
|
async volumeUp(): Promise<void> {
|
|
520
|
-
await this._pressKey(NodePyATVInternalKeys.volumeUp);
|
|
524
|
+
await this._pressKey(NodePyATVInternalKeys.volumeUp, NodePyATVExecutableType.atvscript);
|
|
521
525
|
}
|
|
522
526
|
|
|
523
527
|
/**
|
|
@@ -526,7 +530,7 @@ export default class NodePyATVDevice implements EventEmitter{
|
|
|
526
530
|
* @deprecated
|
|
527
531
|
*/
|
|
528
532
|
async wakeup(): Promise<void> {
|
|
529
|
-
await this._pressKey(NodePyATVInternalKeys.wakeup);
|
|
533
|
+
await this._pressKey(NodePyATVInternalKeys.wakeup, NodePyATVExecutableType.atvscript);
|
|
530
534
|
}
|
|
531
535
|
|
|
532
536
|
/**
|