homebridge-sony-audio-extended 0.0.5-test → 0.0.5
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/README.md +36 -27
- package/dist/api.d.ts +64 -60
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +14 -24
- package/dist/api.js.map +1 -1
- package/dist/discoverer.d.ts +3 -4
- package/dist/discoverer.d.ts.map +1 -1
- package/dist/discoverer.js +36 -14
- package/dist/discoverer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/platform.js +2 -2
- package/dist/platform.js.map +1 -1
- package/dist/sonyAudioAccessory.d.ts +0 -1
- package/dist/sonyAudioAccessory.d.ts.map +1 -1
- package/dist/sonyAudioAccessory.js +73 -61
- package/dist/sonyAudioAccessory.js.map +1 -1
- package/dist/sonyAudioAccessorySettings.d.ts +1 -1
- package/dist/sonyAudioAccessorySettings.d.ts.map +1 -1
- package/dist/sonyAudioAccessorySettings.js +1 -5
- package/dist/sonyAudioAccessorySettings.js.map +1 -1
- package/dist/sonyDevice.d.ts +4 -6
- package/dist/sonyDevice.d.ts.map +1 -1
- package/dist/sonyDevice.js +197 -108
- package/dist/sonyDevice.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
|
|
2
1
|
<p align="center">
|
|
3
2
|
|
|
4
3
|
<img src="https://github.com/homebridge/branding/raw/master/logos/homebridge-wordmark-logo-vertical.png" width="150">
|
|
5
4
|
|
|
6
5
|
</p>
|
|
7
6
|
|
|
8
|
-
|
|
9
7
|
# Homebridge Sony Audio Plugin
|
|
8
|
+
|
|
10
9
|
[](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
|
|
11
10
|
|
|
12
11
|
This is a Homebridge platform plugin allow control the power, volume and input source on a supported Sony audio products.
|
|
13
12
|
|
|
14
13
|
## Features you can control with Sony Audio Plugin
|
|
15
|
-
* power – turn on and off
|
|
16
|
-
* volume – control sound levels including mute via iOS Remote
|
|
17
|
-
* input source – identify sound inputs
|
|
18
|
-
* control arrows, select, back and information buttons via iOS Remote
|
|
19
|
-
* control of input names and their visibility
|
|
20
14
|
|
|
15
|
+
- power – turn on and off
|
|
16
|
+
- volume – control sound levels including mute via iOS Remote
|
|
17
|
+
- input source – identify sound inputs
|
|
18
|
+
- control arrows, select, back and information buttons via iOS Remote
|
|
19
|
+
- control of input names and their visibility
|
|
21
20
|
|
|
22
21
|
For multi-zone environments plugin control current active output zone.
|
|
23
22
|
|
|
24
23
|
## Which Sony devices support the Audio Control API?
|
|
24
|
+
|
|
25
25
|
The following Sony audio products are accessible via the Homebridge Sony Audio Plugin.
|
|
26
26
|
|
|
27
27
|
[**Soundbars**](#soundbars)
|
|
@@ -40,38 +40,44 @@ The following Sony audio products are accessible via the Homebridge Sony Audio P
|
|
|
40
40
|
|
|
41
41
|
### **Soundbars**
|
|
42
42
|
|
|
43
|
-
|Device|Description|More information|
|
|
44
|
-
|
|
45
|
-
|HT-A9|High Performance Home Theater System
|
|
46
|
-
|HT-A7000|7.1.2ch Dolby Atmos® Soundbar
|
|
47
|
-
|HT-A5000|5.1.2ch Dolby Atmos®/ DTS:X® Soundbar
|
|
48
|
-
|HT-ST5000|7.1.2 channel Dolby Atmos/DTS:X soundbar with Wi-Fi/Bluetooth technology
|
|
49
|
-
|HT-MT500|2.1 channel compact soundbar with Wi-Fi/Bluetooth technology
|
|
50
|
-
|HT-ZF9|3.1 channel Dolby Atmos/DTS:X soundbar with Wi-Fi/Bluetooth technology
|
|
51
|
-
|HT-Z9F|3.1 channel Dolby Atmos/DTS:X soundbar with Wi-Fi/Bluetooth technology
|
|
52
|
-
|HT-CT800|2.1 channel soundbar with Wi-Fi/Bluetooth technology
|
|
53
|
-
|
|
43
|
+
| Device | Description | More information |
|
|
44
|
+
| --------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
45
|
+
| HT-A9 | High Performance Home Theater System | <a href="https://electronics.sony.com/tv-video/tv-video-home-theater-sound-bars/soundbars/p/hta9">Product information |
|
|
46
|
+
| HT-A7000 | 7.1.2ch Dolby Atmos® Soundbar | <a href="https://electronics.sony.com/tv-video/tv-video-home-theater-sound-bars/soundbars/p/HT-A7000">Product information</a> |
|
|
47
|
+
| HT-A5000 | 5.1.2ch Dolby Atmos®/ DTS:X® Soundbar | <a href="https://www.sony.co.uk/electronics/sound-bars/ht-a5000">Product information</a> |
|
|
48
|
+
| HT-ST5000 | 7.1.2 channel Dolby Atmos/DTS:X soundbar with Wi-Fi/Bluetooth technology | <a href="https://www.sony.com/electronics/sound-bars/ht-st5000">Product information</a> |
|
|
49
|
+
| HT-MT500 | 2.1 channel compact soundbar with Wi-Fi/Bluetooth technology | |
|
|
50
|
+
| HT-ZF9 | 3.1 channel Dolby Atmos/DTS:X soundbar with Wi-Fi/Bluetooth technology | <a href="https://www.sony.co.uk/electronics/sound-bars/ht-zf9">Product overview</a> |
|
|
51
|
+
| HT-Z9F | 3.1 channel Dolby Atmos/DTS:X soundbar with Wi-Fi/Bluetooth technology | <a href="https://www.sony.com/electronics/sound-bars/ht-z9f">Product overview</a> |
|
|
52
|
+
| HT-CT800 | 2.1 channel soundbar with Wi-Fi/Bluetooth technology | |
|
|
54
53
|
|
|
55
54
|
### **Receivers**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
|
55
|
+
|
|
56
|
+
| Device | Description | More information |
|
|
57
|
+
| ---------- | -------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
|
58
|
+
| STR-DN1080 | 7.2 channel home theater AV receiver | <a href="https://www.sony.co.uk/electronics/av-receivers/str-dn1080">Product information</a> |
|
|
59
|
+
| STR-AN1000 | 8K compatible 7.2 channel home theater AV receiver | <a href="https://www.sony.com/electronics/av-receivers/str-an1000">Product information</a> |
|
|
59
60
|
|
|
60
61
|
### **Speakers**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|SRS-
|
|
62
|
+
|
|
63
|
+
| Device | Description | More information |
|
|
64
|
+
| ---------------- | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
65
|
+
| DeviceSRS-RA5000 | Premium Wireless Speaker with Ambient Room-filling Sound | <a href="https://www.sony.co.uk/electronics/wireless-speakers/srs-ra5000" target="_blank">Product information</a> |
|
|
66
|
+
| SRS-RA3000 | Premium Wireless Speaker with Ambient Room-filling Sound | <a href="https://www.sony.co.uk/electronics/wireless-speakers/srs-ra3000" target="_blank">Product information</a> |
|
|
67
|
+
| SRS-ZR5 | Portable Wireless Bluetooth/Wi-Fi speaker" |
|
|
66
68
|
|
|
67
69
|
## Installation
|
|
70
|
+
|
|
68
71
|
If you are new to homebridge, please first read the homebridge [documentation](https://www.npmjs.com/package/homebridge).
|
|
69
72
|
|
|
70
73
|
### Install homebridge
|
|
74
|
+
|
|
71
75
|
```sh
|
|
72
76
|
npm install -g homebridge
|
|
73
77
|
```
|
|
78
|
+
|
|
74
79
|
### Install homebridge-sony-audio
|
|
80
|
+
|
|
75
81
|
```sh
|
|
76
82
|
npm install -g homebridge-sony-audio
|
|
77
83
|
```
|
|
@@ -80,6 +86,7 @@ npm install -g homebridge-sony-audio
|
|
|
80
86
|
|
|
81
87
|
No special configuration is required.\
|
|
82
88
|
Just add the `SonyAudio` platform to the platforms section:
|
|
89
|
+
|
|
83
90
|
```json
|
|
84
91
|
"platforms": [
|
|
85
92
|
{
|
|
@@ -87,6 +94,7 @@ Just add the `SonyAudio` platform to the platforms section:
|
|
|
87
94
|
}
|
|
88
95
|
]
|
|
89
96
|
```
|
|
97
|
+
|
|
90
98
|
## Adding devices
|
|
91
99
|
|
|
92
100
|
Devices are added automatically through the discovery process.
|
|
@@ -96,9 +104,10 @@ The discovery process to find products connected to your network, uses the Unive
|
|
|
96
104
|
For instructions, see the user manual for your product.
|
|
97
105
|
|
|
98
106
|
## Setting up
|
|
107
|
+
|
|
99
108
|
Finded devices will be publishing externally, so you need paired it seperately:
|
|
109
|
+
|
|
100
110
|
1. In Home.app select "Add Accessory"
|
|
101
111
|
2. Click "I Don't Have a code or Cannot Scan"
|
|
102
112
|
3. On the next screen you find the discovered devices
|
|
103
113
|
4. Tap one and enter the pin code from your homebridge instance.
|
|
104
|
-
|
package/dist/api.d.ts
CHANGED
|
@@ -14,17 +14,7 @@ export declare const ApiRequestSupportedApiInfo: {
|
|
|
14
14
|
* Request to get a general system information for the device.
|
|
15
15
|
* Docs [here](https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_getsysteminformation_v1_4).
|
|
16
16
|
*/
|
|
17
|
-
export declare const
|
|
18
|
-
method: string;
|
|
19
|
-
id: number;
|
|
20
|
-
params: never[];
|
|
21
|
-
version: string;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Request to get a general system information for the device.
|
|
25
|
-
* Docs [here](https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_getsysteminformation_v1_6).
|
|
26
|
-
*/
|
|
27
|
-
export declare const ApiRequestSystemInformationv1_6: {
|
|
17
|
+
export declare const ApiRequestSystemInformation: {
|
|
28
18
|
method: string;
|
|
29
19
|
id: number;
|
|
30
20
|
params: never[];
|
|
@@ -35,23 +25,12 @@ export declare const ApiRequestSystemInformationv1_6: {
|
|
|
35
25
|
* For a device that has no external input or output connectors, this APi should return an empty result with no error codes.
|
|
36
26
|
* Docs [here](https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_getcurrentexternalterminalsstatus_v1_0).
|
|
37
27
|
*/
|
|
38
|
-
export declare const
|
|
28
|
+
export declare const ApiRequestCurrentExternalTerminalsStatus: {
|
|
39
29
|
method: string;
|
|
40
30
|
id: number;
|
|
41
31
|
params: never[];
|
|
42
32
|
version: string;
|
|
43
33
|
};
|
|
44
|
-
/**
|
|
45
|
-
* Request to get an information about the current status of all external input and output terminal sources of the device.
|
|
46
|
-
* For a device that has no external input or output connectors, this APi should return an empty result with no error codes.
|
|
47
|
-
* Docs [here](https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_getcurrentexternalterminalsstatus_v1_2).
|
|
48
|
-
*/
|
|
49
|
-
export declare const ApiRequestCurrentExternalTerminalsStatusv1_2: {
|
|
50
|
-
method: string;
|
|
51
|
-
id: number;
|
|
52
|
-
params: {}[];
|
|
53
|
-
version: string;
|
|
54
|
-
};
|
|
55
34
|
/**
|
|
56
35
|
* Gets the current volume level and mute status.
|
|
57
36
|
* Uses for init info about volume settings.
|
|
@@ -84,6 +63,17 @@ export declare const ApiRequestGetSchemeList: {
|
|
|
84
63
|
params: never[];
|
|
85
64
|
version: string;
|
|
86
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* This API provides the list of available input sources.
|
|
68
|
+
* Lib: `avContent`
|
|
69
|
+
* Docs [here](https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_getsourcelist_v1_3)
|
|
70
|
+
*/
|
|
71
|
+
export declare const ApiRequestGetSourceList: {
|
|
72
|
+
method: string;
|
|
73
|
+
id: number;
|
|
74
|
+
params: {}[];
|
|
75
|
+
version: string;
|
|
76
|
+
};
|
|
87
77
|
/**
|
|
88
78
|
* This API provides information of WebAPI interface provided by the server.
|
|
89
79
|
* Lib: `system`
|
|
@@ -96,7 +86,7 @@ export declare const ApiRequestGetInterfaceInformation: {
|
|
|
96
86
|
params: never[];
|
|
97
87
|
version: string;
|
|
98
88
|
};
|
|
99
|
-
export type ApiNotification = {
|
|
89
|
+
export declare type ApiNotification = {
|
|
100
90
|
name: string;
|
|
101
91
|
version: string;
|
|
102
92
|
};
|
|
@@ -130,9 +120,7 @@ export interface ApiResponceNotifyVolumeInformation {
|
|
|
130
120
|
*/
|
|
131
121
|
export interface ApiResponceNotifyPowerStatus {
|
|
132
122
|
method: NotificationMethods.POWER;
|
|
133
|
-
params: [
|
|
134
|
-
PowerStatus
|
|
135
|
-
];
|
|
123
|
+
params: [PowerStatus];
|
|
136
124
|
version?: string;
|
|
137
125
|
}
|
|
138
126
|
/**
|
|
@@ -141,9 +129,7 @@ export interface ApiResponceNotifyPowerStatus {
|
|
|
141
129
|
*/
|
|
142
130
|
export interface ApiResponceNotifyExternalTerminalStatus {
|
|
143
131
|
method: NotificationMethods.TERMINAL;
|
|
144
|
-
params: [
|
|
145
|
-
ExternalTerminal
|
|
146
|
-
];
|
|
132
|
+
params: [ExternalTerminal];
|
|
147
133
|
version?: string;
|
|
148
134
|
}
|
|
149
135
|
/**
|
|
@@ -158,13 +144,13 @@ export interface PowerStatus {
|
|
|
158
144
|
*/
|
|
159
145
|
standbyDetail?: 'normalStandby' | 'quickStartStandby' | '';
|
|
160
146
|
/**
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
147
|
+
* The current power status of the device.
|
|
148
|
+
* * `active` - The device is in the power-on state.
|
|
149
|
+
* * `standby` - The device is in the standby state.
|
|
150
|
+
* Network functions are active, and the device can switch to the power-on state via a network command.
|
|
151
|
+
* * `shuttingDown` - The device is switching to the power-off state.
|
|
152
|
+
|
|
153
|
+
*/
|
|
168
154
|
status: 'activating' | 'active' | 'standby' | 'shuttingDown';
|
|
169
155
|
}
|
|
170
156
|
/**
|
|
@@ -174,13 +160,13 @@ export interface PowerStatus {
|
|
|
174
160
|
*/
|
|
175
161
|
export interface ExternalTerminal {
|
|
176
162
|
/**
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
163
|
+
* The active status of the terminal.
|
|
164
|
+
* For a terminal type of "meta:zone:output", the active status indicates whether the zone is enabled.
|
|
165
|
+
* For all other terminal types, the active status indicates whether the source is selected as an input source for any output zone.
|
|
166
|
+
* * `` - The active status could not be determined.
|
|
167
|
+
* * `active` - The terminal is enabled or a selected input source.
|
|
168
|
+
* * `inactive` - The terminal is disabled or not a selected input source.
|
|
169
|
+
*/
|
|
184
170
|
active?: '' | 'active' | 'inactive';
|
|
185
171
|
/**
|
|
186
172
|
* The connection status of the terminal.
|
|
@@ -230,9 +216,7 @@ export interface ExternalTerminal {
|
|
|
230
216
|
*/
|
|
231
217
|
export interface ApiResponcePowerStatus {
|
|
232
218
|
id: number;
|
|
233
|
-
result: [
|
|
234
|
-
PowerStatus
|
|
235
|
-
];
|
|
219
|
+
result: [PowerStatus];
|
|
236
220
|
}
|
|
237
221
|
/**
|
|
238
222
|
* Describes the device volume settings.
|
|
@@ -274,9 +258,7 @@ export interface VolumeInformation {
|
|
|
274
258
|
*/
|
|
275
259
|
export interface ApiResponceVolumeInformation {
|
|
276
260
|
id: number;
|
|
277
|
-
result: [
|
|
278
|
-
VolumeInformation[]
|
|
279
|
-
];
|
|
261
|
+
result: [VolumeInformation[]];
|
|
280
262
|
}
|
|
281
263
|
/**
|
|
282
264
|
* Provides the list of schemes that device can handle.
|
|
@@ -295,14 +277,40 @@ export interface ApiResponceSchemeList {
|
|
|
295
277
|
]
|
|
296
278
|
];
|
|
297
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* Source information from getSourceList API
|
|
282
|
+
*/
|
|
283
|
+
export interface SourceInfo {
|
|
284
|
+
/**
|
|
285
|
+
* The source URI
|
|
286
|
+
*/
|
|
287
|
+
uri: string;
|
|
288
|
+
/**
|
|
289
|
+
* The source title/name
|
|
290
|
+
*/
|
|
291
|
+
title?: string;
|
|
292
|
+
/**
|
|
293
|
+
* The source icon URL
|
|
294
|
+
*/
|
|
295
|
+
iconUrl?: string;
|
|
296
|
+
/**
|
|
297
|
+
* The source meta type
|
|
298
|
+
*/
|
|
299
|
+
meta?: string;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Provides the list of available input sources.
|
|
303
|
+
*/
|
|
304
|
+
export interface ApiResponceSourceList {
|
|
305
|
+
id: number;
|
|
306
|
+
result: [SourceInfo[]];
|
|
307
|
+
}
|
|
298
308
|
/**
|
|
299
309
|
* Provides an information about the current status of all external input and output terminal sources.
|
|
300
310
|
*/
|
|
301
311
|
export interface ApiResponceExternalTerminalStatus {
|
|
302
312
|
id: number;
|
|
303
|
-
result: [
|
|
304
|
-
ExternalTerminal[]
|
|
305
|
-
];
|
|
313
|
+
result: [ExternalTerminal[]];
|
|
306
314
|
}
|
|
307
315
|
/**
|
|
308
316
|
* Describes the device playing content.
|
|
@@ -325,16 +333,14 @@ export interface PlayingContentInfo {
|
|
|
325
333
|
*/
|
|
326
334
|
export interface ApiResponceNotifyPlayingContentInfo {
|
|
327
335
|
method: NotificationMethods.CONTENT;
|
|
328
|
-
params: [
|
|
329
|
-
PlayingContentInfo
|
|
330
|
-
];
|
|
336
|
+
params: [PlayingContentInfo];
|
|
331
337
|
version: string;
|
|
332
338
|
}
|
|
333
339
|
/**
|
|
334
340
|
* Responce type for Subscribes and unsubscribes to multiple notifications at a time.
|
|
335
341
|
* Docs [here](https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_switchnotifications_v1_0)
|
|
336
342
|
*/
|
|
337
|
-
export type ApiResponceSwitchNotifications = {
|
|
343
|
+
export declare type ApiResponceSwitchNotifications = {
|
|
338
344
|
id: number;
|
|
339
345
|
result: {
|
|
340
346
|
disabled: ApiNotification[];
|
|
@@ -555,9 +561,7 @@ export interface ApiRequestPlayingContentInfo {
|
|
|
555
561
|
*/
|
|
556
562
|
export interface ApiResponcePlayingContentInfo {
|
|
557
563
|
id: number;
|
|
558
|
-
result: [
|
|
559
|
-
PlayingContentInfo[]
|
|
560
|
-
];
|
|
564
|
+
result: [PlayingContentInfo[]];
|
|
561
565
|
}
|
|
562
566
|
/**
|
|
563
567
|
* Provides information of WebAPI interface provided by the server.
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;;CAStC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM
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BAAkB;IAC1B;;OAEG;IACH,OAAO,iBAAiB;IACxB;;OAEG;IACH,EAAE,YAAY;IACd;;OAEG;IACH,cAAc,wBAAwB;IACtC;;OAEG;IACH,eAAe,yBAAyB;IACxC;;OAEG;IACH,KAAK,eAAe;IACpB;;OAEG;IACH,MAAM,gBAAgB;IACtB;;OAEG;IACH,IAAI,cAAc;IAClB;;OAEG;IACH,KAAK,eAAe;IACpB;;OAEG;IACH,WAAW,qBAAqB;IAChC;;OAEG;IACH,EAAE,YAAY;IACd;;OAEG;IACH,MAAM,gBAAgB;IACtB;;OAEG;IACH,WAAW,qBAAqB;IAChC;;OAEG;IACH,0BAA0B,oCAAoC;IAC9D;;OAEG;IACH,MAAM,gBAAgB;IACtB;;OAEG;IACH,OAAO,iBAAiB;IACxB;;OAEG;IACH,QAAQ,kBAAkB;IAC1B;;OAEG;IACH,KAAK,eAAe;IACpB;;OAEG;IACH,WAAW,qBAAqB;CACjC;AAED,0BAAkB,mBAAmB;IACnC,KAAK,sBAAsB;IAC3B,MAAM,4BAA4B;IAClC,QAAQ,iCAAiC;IACzC,OAAO,6BAA6B;CACrC"}
|
package/dist/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IncompatibleDeviceCategoryError = exports.UnsupportedVersionApiError = exports.GenericApiError = exports.ApiRequestGetInterfaceInformation = exports.
|
|
3
|
+
exports.IncompatibleDeviceCategoryError = exports.UnsupportedVersionApiError = exports.GenericApiError = exports.ApiRequestGetInterfaceInformation = exports.ApiRequestGetSourceList = exports.ApiRequestGetSchemeList = exports.ApiRequestGetPowerStatus = exports.ApiRequestVolumeInformation = exports.ApiRequestCurrentExternalTerminalsStatus = exports.ApiRequestSystemInformation = exports.ApiRequestSupportedApiInfo = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Request to get a supported services and its information
|
|
6
6
|
* Docs [here](https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_getsupportedapiinfo_v1_0).
|
|
@@ -19,17 +19,7 @@ exports.ApiRequestSupportedApiInfo = {
|
|
|
19
19
|
* Request to get a general system information for the device.
|
|
20
20
|
* Docs [here](https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_getsysteminformation_v1_4).
|
|
21
21
|
*/
|
|
22
|
-
exports.
|
|
23
|
-
method: 'getSystemInformation',
|
|
24
|
-
id: 64,
|
|
25
|
-
params: [],
|
|
26
|
-
version: '1.4',
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Request to get a general system information for the device.
|
|
30
|
-
* Docs [here](https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_getsysteminformation_v1_6).
|
|
31
|
-
*/
|
|
32
|
-
exports.ApiRequestSystemInformationv1_6 = {
|
|
22
|
+
exports.ApiRequestSystemInformation = {
|
|
33
23
|
method: 'getSystemInformation',
|
|
34
24
|
id: 65,
|
|
35
25
|
params: [],
|
|
@@ -40,23 +30,12 @@ exports.ApiRequestSystemInformationv1_6 = {
|
|
|
40
30
|
* For a device that has no external input or output connectors, this APi should return an empty result with no error codes.
|
|
41
31
|
* Docs [here](https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_getcurrentexternalterminalsstatus_v1_0).
|
|
42
32
|
*/
|
|
43
|
-
exports.
|
|
33
|
+
exports.ApiRequestCurrentExternalTerminalsStatus = {
|
|
44
34
|
method: 'getCurrentExternalTerminalsStatus',
|
|
45
35
|
id: 66,
|
|
46
36
|
params: [],
|
|
47
37
|
version: '1.0',
|
|
48
38
|
};
|
|
49
|
-
/**
|
|
50
|
-
* Request to get an information about the current status of all external input and output terminal sources of the device.
|
|
51
|
-
* For a device that has no external input or output connectors, this APi should return an empty result with no error codes.
|
|
52
|
-
* Docs [here](https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_getcurrentexternalterminalsstatus_v1_2).
|
|
53
|
-
*/
|
|
54
|
-
exports.ApiRequestCurrentExternalTerminalsStatusv1_2 = {
|
|
55
|
-
method: 'getCurrentExternalTerminalsStatus',
|
|
56
|
-
id: 67,
|
|
57
|
-
params: [{}],
|
|
58
|
-
version: '1.2',
|
|
59
|
-
};
|
|
60
39
|
/**
|
|
61
40
|
* Gets the current volume level and mute status.
|
|
62
41
|
* Uses for init info about volume settings.
|
|
@@ -89,6 +68,17 @@ exports.ApiRequestGetSchemeList = {
|
|
|
89
68
|
params: [],
|
|
90
69
|
version: '1.0',
|
|
91
70
|
};
|
|
71
|
+
/**
|
|
72
|
+
* This API provides the list of available input sources.
|
|
73
|
+
* Lib: `avContent`
|
|
74
|
+
* Docs [here](https://developer.sony.com/develop/audio-control-api/api-references/api-overview-2#_getsourcelist_v1_3)
|
|
75
|
+
*/
|
|
76
|
+
exports.ApiRequestGetSourceList = {
|
|
77
|
+
method: 'getSourceList',
|
|
78
|
+
id: 100,
|
|
79
|
+
params: [{}],
|
|
80
|
+
version: '1.3',
|
|
81
|
+
};
|
|
92
82
|
/**
|
|
93
83
|
* This API provides information of WebAPI interface provided by the server.
|
|
94
84
|
* Lib: `system`
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACU,QAAA,0BAA0B,GAAG;IACxC,EAAE,EAAE,CAAC;IACL,MAAM,EAAE,qBAAqB;IAC7B,MAAM,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACU,QAAA,0BAA0B,GAAG;IACxC,EAAE,EAAE,CAAC;IACL,MAAM,EAAE,qBAAqB;IAC7B,MAAM,EAAE;QACN;YACE,QAAQ,EAAE,IAAI;SACf;KACF;IACD,OAAO,EAAE,KAAK;CACf,CAAC;AAEF;;;GAGG;AACU,QAAA,2BAA2B,GAAG;IACzC,MAAM,EAAE,sBAAsB;IAC9B,EAAE,EAAE,E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C,CAAC;SAChD;QACD,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IAChB,CAAC;CACF;AAZD,0CAYC;AAED,MAAa,0BAA2B,SAAQ,eAAe;IAG7D,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IACjB,CAAC;CACF;AARD,gEAQC;AAED,MAAa,+BAAgC,SAAQ,KAAK;IACxD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,+BAA+B,CAAC,SAAS,CAAC,CAAC;QACvE,IAAI,KAAK,CAAC,iBAAiB,EAAE;YAC3B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,+BAA+B,CAAC,CAAC;SAChE;QACD,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;IAC7C,CAAC;CACF;AATD,0EASC"}
|
package/dist/discoverer.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { SonyDevice } from './sonyDevice';
|
|
4
|
-
import { Logger } from 'homebridge';
|
|
5
2
|
import { AxiosResponse } from 'axios';
|
|
6
|
-
import { URL } from 'url';
|
|
7
3
|
import EventEmitter from 'events';
|
|
4
|
+
import { Logger } from 'homebridge';
|
|
5
|
+
import { SonyDevice } from './sonyDevice';
|
|
6
|
+
import { URL } from 'url';
|
|
8
7
|
export declare const enum DiscoveryEvents {
|
|
9
8
|
NewDeviceFound = "new-device-found"
|
|
10
9
|
}
|
package/dist/discoverer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discoverer.d.ts","sourceRoot":"","sources":["../src/discoverer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"discoverer.d.ts","sourceRoot":"","sources":["../src/discoverer.ts"],"names":[],"mappings":";AAKA,OAAc,EAA6B,aAAa,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAU1B,0BAAkB,eAAe;IAC/B,cAAc,qBAAqB;CACpC;AAID;;;GAGG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAU9B,OAAO,CAAC,QAAQ,CAAC,GAAG;IAThC,OAAO,CAAC,OAAO,CAA0C;IACzD,OAAO,CAAC,UAAU,CAAC;IACnB,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,MAAM,CAAC,CAAiB;IAChC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAsB;gBAEP,GAAG,EAAE,MAAM;IAoBxC;;;OAGG;IACI,cAAc;IAOrB;;OAEG;IACI,aAAa;IAMpB,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM;IAgChE,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG;IA8HzC,YAAY,CACV,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IA4B7B;;;;OAIG;IACH,mBAAmB,CAAC,QAAQ,EAAE,aAAa;CAW5C"}
|
package/dist/discoverer.js
CHANGED
|
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Discoverer = void 0;
|
|
7
|
+
const api_1 = require("./api");
|
|
8
|
+
const axios_1 = __importDefault(require("axios"));
|
|
9
|
+
const events_1 = __importDefault(require("events"));
|
|
7
10
|
/* eslint-disable max-len */
|
|
8
11
|
const sonyDevice_1 = require("./sonyDevice");
|
|
9
|
-
const
|
|
12
|
+
const url_1 = require("url");
|
|
10
13
|
const node_ssdp_1 = require("node-ssdp");
|
|
11
|
-
const axios_1 = __importDefault(require("axios"));
|
|
12
14
|
const fast_xml_parser_1 = __importDefault(require("fast-xml-parser"));
|
|
13
|
-
const url_1 = require("url");
|
|
14
|
-
const events_1 = __importDefault(require("events"));
|
|
15
15
|
/**
|
|
16
16
|
* The search target for devices supporting Audio Control API
|
|
17
17
|
*/
|
|
@@ -86,7 +86,8 @@ class Discoverer extends events_1.default {
|
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
88
|
// retrieve the device description
|
|
89
|
-
axios_1.default
|
|
89
|
+
axios_1.default
|
|
90
|
+
.get(location.href)
|
|
90
91
|
.then((response) => {
|
|
91
92
|
var _a, _b, _c;
|
|
92
93
|
this.errors.delete(location.href); // clear error if device responded
|
|
@@ -111,7 +112,8 @@ class Discoverer extends events_1.default {
|
|
|
111
112
|
}
|
|
112
113
|
this.devices.set(usn, 'REGISTERING');
|
|
113
114
|
// Retrive IRCC service url
|
|
114
|
-
const serviceList = deviceDescription.root.device.serviceList
|
|
115
|
+
const serviceList = deviceDescription.root.device.serviceList
|
|
116
|
+
.service;
|
|
115
117
|
let irccServiceUrl = '';
|
|
116
118
|
let irccServiceExist = false;
|
|
117
119
|
for (let i = 0; i < serviceList.length; i++) {
|
|
@@ -123,7 +125,16 @@ class Discoverer extends events_1.default {
|
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
const reAbsoluteUrl = new RegExp('^(?:[a-z]+:)?//', 'i');
|
|
126
|
-
const upnpBaseUrl = irccServiceExist
|
|
128
|
+
const upnpBaseUrl = irccServiceExist
|
|
129
|
+
? reAbsoluteUrl.test(irccServiceUrl)
|
|
130
|
+
? irccServiceUrl
|
|
131
|
+
: location.protocol +
|
|
132
|
+
'//' +
|
|
133
|
+
location.hostname +
|
|
134
|
+
':' +
|
|
135
|
+
location.port +
|
|
136
|
+
irccServiceUrl
|
|
137
|
+
: '';
|
|
127
138
|
const deviceBaseUrl = (_c = deviceDescription.root.device['av:X_ScalarWebAPI_DeviceInfo']) === null || _c === void 0 ? void 0 : _c['av:X_ScalarWebAPI_BaseURL'];
|
|
128
139
|
// const deviceServices = deviceDescription.root.device['av:X_ScalarWebAPI_DeviceInfo']?.['av:X_ScalarWebAPI_ServiceList']?.['av:X_ScalarWebAPI_ServiceType'];
|
|
129
140
|
const deviceFriendlyName = deviceDescription.root.device.friendlyName;
|
|
@@ -137,16 +148,25 @@ class Discoverer extends events_1.default {
|
|
|
137
148
|
this.devices.set(usn, null);
|
|
138
149
|
return;
|
|
139
150
|
}
|
|
140
|
-
this.createDevice(deviceBaseUrl, upnpBaseUrl, deviceUDN, {
|
|
141
|
-
|
|
151
|
+
this.createDevice(deviceBaseUrl, upnpBaseUrl, deviceUDN, {
|
|
152
|
+
friendlyName: deviceFriendlyName,
|
|
153
|
+
manufacturer: deviceManufacturer,
|
|
154
|
+
modelName: deviceModelName,
|
|
155
|
+
})
|
|
156
|
+
.then((device) => {
|
|
142
157
|
this.devices.set(usn, device);
|
|
143
158
|
// emit an event about new found device
|
|
144
|
-
this.emit("new-device-found" /*
|
|
159
|
+
this.emit("new-device-found" /* NewDeviceFound */, device);
|
|
145
160
|
this.log.info('Compatible device found, added:', device.systemInfo.name);
|
|
146
161
|
})
|
|
147
|
-
.catch(() => {
|
|
162
|
+
.catch((err) => {
|
|
148
163
|
this.devices.set(usn, null);
|
|
149
|
-
|
|
164
|
+
if (err instanceof api_1.IncompatibleDeviceCategoryError) {
|
|
165
|
+
this.log.info('Incompatible device found, skipped:', deviceFriendlyName, '-', err.message);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
this.log.info('Incompatible device found, skipped:', deviceFriendlyName);
|
|
169
|
+
}
|
|
150
170
|
});
|
|
151
171
|
})
|
|
152
172
|
.catch((err) => {
|
|
@@ -165,11 +185,13 @@ class Discoverer extends events_1.default {
|
|
|
165
185
|
sonyDevice_1.SonyDevice.createDevice(deviceUrl, upnpUrl, udn, this.log)
|
|
166
186
|
.then((device) => {
|
|
167
187
|
device.systemInfo.name = opt.friendlyName ? opt.friendlyName : '';
|
|
168
|
-
device.manufacturer = opt.manufacturer
|
|
188
|
+
device.manufacturer = opt.manufacturer
|
|
189
|
+
? opt.manufacturer
|
|
190
|
+
: device.manufacturer;
|
|
169
191
|
device.systemInfo.model = opt.modelName ? opt.modelName : '';
|
|
170
192
|
resolve(device);
|
|
171
193
|
})
|
|
172
|
-
.catch(err => {
|
|
194
|
+
.catch((err) => {
|
|
173
195
|
if (err instanceof api_1.UnsupportedVersionApiError) {
|
|
174
196
|
this.log.debug(err.message);
|
|
175
197
|
}
|
package/dist/discoverer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discoverer.js","sourceRoot":"","sources":["../src/discoverer.ts"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,6CAA0C;AAC1C
|
|
1
|
+
{"version":3,"file":"discoverer.js","sourceRoot":"","sources":["../src/discoverer.ts"],"names":[],"mappings":";;;;;;AAAA,+BAIe;AACf,kDAAwE;AAExE,oDAAkC;AAElC,4BAA4B;AAC5B,6CAA0C;AAC1C,6BAA0B;AAE1B,yCAA2C;AAC3C,sEAAwC;AAExC;;GAEG;AACH,MAAM,kBAAkB,GAAG,6CAA6C,CAAC;AAQzE;;;GAGG;AACH,MAAa,UAAW,SAAQ,gBAAY;IAU1C,YAA6B,GAAW;QACtC,KAAK,EAAE,CAAC;QADmB,QAAG,GAAH,GAAG,CAAQ;QAEtC,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;QAC7C,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC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