@basmilius/apple-devices 0.0.89 → 0.0.91
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/dist/companion-link/device.d.ts +2 -2
- package/dist/index.js +8 -8
- package/package.json +5 -5
|
@@ -11,8 +11,8 @@ export default class extends EventEmitter<EventMap> {
|
|
|
11
11
|
get isConnected(): boolean;
|
|
12
12
|
constructor(discoveryResult: DiscoveryResult);
|
|
13
13
|
connect(): Promise<void>;
|
|
14
|
-
disconnect(): Promise<void>;
|
|
15
|
-
disconnectSafely(): Promise<void>;
|
|
14
|
+
disconnect(emit?: boolean): Promise<void>;
|
|
15
|
+
disconnectSafely(emit?: boolean): Promise<void>;
|
|
16
16
|
setCredentials(credentials: AccessoryCredentials): Promise<void>;
|
|
17
17
|
setDiscoveryResult(discoveryResult: DiscoveryResult): Promise<void>;
|
|
18
18
|
getAttentionState(): Promise<AttentionState>;
|
package/dist/index.js
CHANGED
|
@@ -1692,16 +1692,18 @@ class device_default2 extends EventEmitter3 {
|
|
|
1692
1692
|
await this.#setup();
|
|
1693
1693
|
this.emit("connected");
|
|
1694
1694
|
}
|
|
1695
|
-
async disconnect() {
|
|
1695
|
+
async disconnect(emit = true) {
|
|
1696
1696
|
this.#disconnect = true;
|
|
1697
1697
|
clearInterval(this.#heartbeatInterval);
|
|
1698
1698
|
await this.#unsubscribe();
|
|
1699
1699
|
await this.#protocol.disconnect();
|
|
1700
|
-
|
|
1700
|
+
if (emit) {
|
|
1701
|
+
this.emit("disconnected", false);
|
|
1702
|
+
}
|
|
1701
1703
|
}
|
|
1702
|
-
async disconnectSafely() {
|
|
1704
|
+
async disconnectSafely(emit = true) {
|
|
1703
1705
|
try {
|
|
1704
|
-
await this.disconnect();
|
|
1706
|
+
await this.disconnect(emit);
|
|
1705
1707
|
} catch (_) {}
|
|
1706
1708
|
}
|
|
1707
1709
|
async setCredentials(credentials) {
|
|
@@ -1750,14 +1752,12 @@ class device_default2 extends EventEmitter3 {
|
|
|
1750
1752
|
}
|
|
1751
1753
|
async#onError(err) {
|
|
1752
1754
|
reporter3.error("Companion Link error", err);
|
|
1753
|
-
|
|
1754
|
-
await this.disconnect();
|
|
1755
|
-
} catch (_) {}
|
|
1755
|
+
await this.disconnectSafely(false);
|
|
1756
1756
|
this.emit("disconnected", true);
|
|
1757
1757
|
}
|
|
1758
1758
|
async#onTimeout() {
|
|
1759
1759
|
reporter3.error("Companion Link timeout");
|
|
1760
|
-
await this.disconnectSafely();
|
|
1760
|
+
await this.disconnectSafely(false);
|
|
1761
1761
|
this.emit("disconnected", true);
|
|
1762
1762
|
}
|
|
1763
1763
|
async#setup() {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basmilius/apple-devices",
|
|
3
3
|
"description": "Exposes various Apple devices to connect with either AirPlay or Companion Link.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.91",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@basmilius/apple-airplay": "0.0.
|
|
47
|
-
"@basmilius/apple-common": "0.0.
|
|
48
|
-
"@basmilius/apple-companion-link": "0.0.
|
|
49
|
-
"@basmilius/apple-encoding": "0.0.
|
|
46
|
+
"@basmilius/apple-airplay": "0.0.91",
|
|
47
|
+
"@basmilius/apple-common": "0.0.91",
|
|
48
|
+
"@basmilius/apple-companion-link": "0.0.91",
|
|
49
|
+
"@basmilius/apple-encoding": "0.0.91"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@basmilius/tools": "^2.23.0",
|