@o-lukas/homebridge-smartthings-tv 2.1.2 → 2.2.0-next.1
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 +49 -28
- package/dist/smartThingsPlatform.d.ts +9 -0
- package/dist/smartThingsPlatform.d.ts.map +1 -1
- package/dist/smartThingsPlatform.js +36 -1
- package/dist/smartThingsPlatform.js.map +1 -1
- package/dist/soundbarAccessory.d.ts +128 -0
- package/dist/soundbarAccessory.d.ts.map +1 -0
- package/dist/soundbarAccessory.js +354 -0
- package/dist/soundbarAccessory.js.map +1 -0
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|

|
|
9
9
|
[](https://github.com/o-lukas/homebridge-smartthings-tv/actions/workflows/build.yml)
|
|
10
10
|
|
|
11
|
-
This is a plugin for [Homebridge](https://github.com/homebridge/homebridge). It offers some basic functions to control Samsung TVs using the SmartThings API.
|
|
11
|
+
This is a plugin for [Homebridge](https://github.com/homebridge/homebridge). It offers some basic functions to control Samsung TVs and SoundBars using the SmartThings API.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Both device types will be registered as TVs because this is the only device type that is able to control input sources at the moment.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## Configuration
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
The easiest way to configure the plugin is to use [Homebridge Config UI X](https://github.com/oznu/homebridge-config-ui-x) which should contain a description for every needed property. The only property needed to make the plugin work is the SmartThings API token. The other properties enable some additional functions but are not mandatory for the plugin to work.
|
|
18
18
|
|
|
19
19
|
The following snippet shows the most simple configuration you can use for the plugin:
|
|
20
20
|
|
|
@@ -99,8 +99,6 @@ The following snippets shows all available properties you can use for the plugin
|
|
|
99
99
|
}
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
## Available configuration properties
|
|
103
|
-
|
|
104
102
|
### token
|
|
105
103
|
|
|
106
104
|
The SmartThings API token is needed to authenticate the requests sent to the SmartThings API. To generate a token open [SmartThings website]( https://account.smartthings.com/tokens) and generate a new one (make sure at least devices is selected).
|
|
@@ -117,14 +115,23 @@ Enable debug logging for cyclic calls (e.g. polling).
|
|
|
117
115
|
|
|
118
116
|
To use installed application as input sources, a [predefined list of applications](./src/res/apps.json) will be used. This list will be checked for availability at the TV(s) and eventually be registered as input sources. Make sure to have the TV(s) turned on when starting your instance as this functionality requires your TV(s) be turned on to determine whether an application is installed or not. On startup the applications will be opened to determine if they are available. Do not use your TV until the input source is being changed back to the first one (usually Live TV).
|
|
119
117
|
|
|
118
|
+
> [!NOTE]
|
|
119
|
+
> Not implemented for SoundBars.
|
|
120
|
+
|
|
120
121
|
### registerPictureModes
|
|
121
122
|
|
|
122
123
|
Registers all available picture modes as separate switches that can be toggled to enable/disable a picture mode. Uses the names as exposed from the SmartThings API.
|
|
123
124
|
|
|
125
|
+
> [!NOTE]
|
|
126
|
+
> Not implemented for SoundBars.
|
|
127
|
+
|
|
124
128
|
### registerSoundModes
|
|
125
129
|
|
|
126
130
|
Registers all available sound modes as separate switches that can be toggled to enable/disable a sound mode. Uses the names as exposed from the SmartThings API.
|
|
127
131
|
|
|
132
|
+
> [!NOTE]
|
|
133
|
+
> Not implemented for SoundBars.
|
|
134
|
+
|
|
128
135
|
### registerVolumeSlider
|
|
129
136
|
|
|
130
137
|
Registers a separate volume slider accessorry that will be exposed as a light bulb accessory (because there is currently no option to change a speaker volume directly using Home).
|
|
@@ -141,67 +148,81 @@ Devices not to be registered.
|
|
|
141
148
|
|
|
142
149
|
Use the device mappings when e.g. turning on the accessory does not work as expected. When a device mapping is available the wake-on-lan functionality is used to turn on the device instead of the SmartThings API. To make use of the functionality you must enter the mapping using the SmartThings device ID and the mac address of the device. If status does not show up properly you can use the ping functionality to determine the device status. To make use of it you must enter the SmartThings device ID and the ip address of the device.
|
|
143
150
|
|
|
151
|
+
The following table gives an overview which properties do work for the device types:
|
|
152
|
+
|
|
153
|
+
| Configuration property | TV | SoundBar |
|
|
154
|
+
| ---------------------- | ------------------ | ------------------ |
|
|
155
|
+
| deviceId | :white_check_mark: | :white_check_mark: |
|
|
156
|
+
| nameOverride | :white_check_mark: | :white_check_mark: |
|
|
157
|
+
| wol | :white_check_mark: | :white_check_mark: |
|
|
158
|
+
| macAddress | :white_check_mark: | :white_check_mark: |
|
|
159
|
+
| ping | :white_check_mark: | :white_check_mark: |
|
|
160
|
+
| ipAddress | :white_check_mark: | :white_check_mark: |
|
|
161
|
+
| infoKey | :white_check_mark: | :x: |
|
|
162
|
+
| inputSources | :white_check_mark: | :white_check_mark: |
|
|
163
|
+
| applications | :white_check_mark: | :x: |
|
|
164
|
+
|
|
144
165
|
#### deviceId
|
|
145
166
|
|
|
146
|
-
The SmartThings device id. Check the log or go to https://account.smartthings.com
|
|
167
|
+
The SmartThings device id. Check the log or go to <https://account.smartthings.com/> and get the device id.
|
|
147
168
|
|
|
148
|
-
|
|
169
|
+
#### nameOverride
|
|
149
170
|
|
|
150
171
|
Use this to override the default display name of the device. Must be configured here because name configured in HomeKit will get lost after restart.
|
|
151
172
|
|
|
152
|
-
|
|
173
|
+
#### wol
|
|
153
174
|
|
|
154
175
|
Enables usage of wake-on-lan functionality to turn the device on. Use only if using the SmartThings API does not work for your device.
|
|
155
176
|
|
|
156
|
-
|
|
177
|
+
#### macAddress
|
|
157
178
|
|
|
158
179
|
The mac address of the device to turn device on using wake-on-lan functionality.
|
|
159
180
|
|
|
160
|
-
|
|
181
|
+
#### ping
|
|
161
182
|
|
|
162
183
|
Enables usage of ping functionality to determine if device is turned on. Use only if using the SmartThings API does not work for your device.
|
|
163
184
|
|
|
164
|
-
|
|
185
|
+
#### ipAddress
|
|
165
186
|
|
|
166
187
|
The IP address of the device (assign a static IP address to make sure it does not change) to determine the status using ping.
|
|
167
188
|
|
|
168
|
-
|
|
189
|
+
#### infoKey
|
|
169
190
|
|
|
170
191
|
The key to be emulated when pressing info button in HomeKit remote. The list of valid values must be read from the log as it differs per device. To do so enable capabilityLogging and look for log entry containing the possible values.
|
|
171
192
|
|
|
172
|
-
|
|
193
|
+
#### inputSources
|
|
173
194
|
|
|
174
195
|
Overrides the device's default input sources map to add custom input sources. Check the log for information about the default input sources.
|
|
175
196
|
|
|
176
|
-
|
|
197
|
+
##### name
|
|
177
198
|
|
|
178
199
|
The input source's name.
|
|
179
200
|
|
|
180
|
-
|
|
201
|
+
##### id
|
|
181
202
|
|
|
182
203
|
The input source's id.
|
|
183
204
|
|
|
184
|
-
|
|
205
|
+
#### applications
|
|
185
206
|
|
|
186
207
|
Overrides the default application mapping list to add custom applications. See [registerApplications](#registerapplications) for more details about application registration.
|
|
187
208
|
|
|
188
|
-
|
|
209
|
+
##### name
|
|
189
210
|
|
|
190
211
|
The application's name.
|
|
191
212
|
|
|
192
|
-
|
|
213
|
+
##### ids
|
|
193
214
|
|
|
194
215
|
The application's possible ids. Since some applications have different ids for different versions of TVs you can provide a list here so the plugin will try every id and use the one that's working.
|
|
195
216
|
|
|
196
|
-
|
|
217
|
+
## Common issues
|
|
197
218
|
|
|
198
|
-
|
|
219
|
+
### TV does not show in HomeKit
|
|
199
220
|
|
|
200
221
|
After starting you have to add the TV manually to HomeKit because they are published as external accessory to get over the limit of only one TV per bridge.
|
|
201
222
|
|
|
202
223
|
If your TV is lost after an update/restart/etc. you might need to reset the connection. To do so reset the externally published accessories in Homebridge using: Unpair Bridges / Cameras / TVs / External Accessories in the Homebridge settings.
|
|
203
224
|
|
|
204
|
-
|
|
225
|
+
### TV does not turn on
|
|
205
226
|
|
|
206
227
|
The command to turn the TV on using the SmartThings API does not work for some TVs. To solve this problem you can use the built-in wake-on-lan functionality. To activate this functionality add a device mapping containing the device id and the mac address of your TV.
|
|
207
228
|
|
|
@@ -226,7 +247,7 @@ The command to turn the TV on using the SmartThings API does not work for some T
|
|
|
226
247
|
}
|
|
227
248
|
```
|
|
228
249
|
|
|
229
|
-
|
|
250
|
+
### TV state does not match actual state
|
|
230
251
|
|
|
231
252
|
Some TVs report a false active state using the SmartThings API. To get the actual state of the television you can use the build-in ping functionality. To activate this functionality add a device mapping containing the device id and the IP address of your TV.
|
|
232
253
|
|
|
@@ -251,21 +272,21 @@ Some TVs report a false active state using the SmartThings API. To get the actua
|
|
|
251
272
|
}
|
|
252
273
|
```
|
|
253
274
|
|
|
254
|
-
|
|
275
|
+
### Picture/sound mode switches do not match TV picture mode settings
|
|
255
276
|
|
|
256
277
|
Some TVs always report the same picture & sound mode. This will cause the exposed switches to not match the actual picture/sound mode state. I have not found a proper solution for this problem yet. But toggling the buttons will still work.
|
|
257
278
|
|
|
258
|
-
|
|
279
|
+
### Error `invalid device state`
|
|
259
280
|
|
|
260
281
|
Sometimes the SmartThings API seems to loose the contact to the device and does not update it's state so every request will end up with an error message like `invalid device state`. To fix this try to remove the device from your SmartThings account and add it again. This seems to fix the problem.
|
|
261
282
|
|
|
262
|
-
|
|
283
|
+
### DisplayPort input sources do not show up
|
|
263
284
|
|
|
264
285
|
For some TVs display port sources do not show up. When having the same problem you might try to use [inputSources](#inputsources). `Id` might be something like `Display Port` but you will have to experiment a bit trying different ids until you find the the right one.
|
|
265
286
|
|
|
266
|
-
|
|
287
|
+
### Name of TV gets reset in HomeKit after HomeBridge restart
|
|
267
288
|
|
|
268
|
-
The configured name can not be cached because TV is published as external accessory. To permanently change the name use [nameOverride](#
|
|
289
|
+
The configured name can not be cached because TV is published as external accessory. To permanently change the name use [nameOverride](#nameoverride).
|
|
269
290
|
|
|
270
291
|
***
|
|
271
292
|
|
|
@@ -65,6 +65,15 @@ export declare class SmartThingsPlatform implements DynamicPlatformPlugin {
|
|
|
65
65
|
* @param deviceMappings the array of configured DeviceMapping
|
|
66
66
|
*/
|
|
67
67
|
registerTvDevice(client: SmartThingsClient, device: Device, deviceMapping: DeviceMapping | undefined): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Registers a SmartThings Soundbar Device for Homebridge.
|
|
70
|
+
*
|
|
71
|
+
* @param client the SmartThingsClient used to send API calls
|
|
72
|
+
* @param device the SmartThings Device
|
|
73
|
+
* @param accessory the cached PlatformAccessory or undefined if no cached PlatformAccessory exists
|
|
74
|
+
* @param deviceMappings the array of configured DeviceMapping
|
|
75
|
+
*/
|
|
76
|
+
registerSoundbarDevice(client: SmartThingsClient, device: Device, deviceMapping: DeviceMapping | undefined): Promise<void>;
|
|
68
77
|
/**
|
|
69
78
|
* Register the modes of the device passed in as platform accessories.
|
|
70
79
|
* Handles caching of accessories as well.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartThingsPlatform.d.ts","sourceRoot":"","sources":["../src/smartThingsPlatform.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,qBAAqB,EACrB,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,cAAc,EAEf,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,iBAAiB,EAA4B,MAAM,EAAE,SAAS,EAAoB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"smartThingsPlatform.d.ts","sourceRoot":"","sources":["../src/smartThingsPlatform.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,qBAAqB,EACrB,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,cAAc,EAEf,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,iBAAiB,EAA4B,MAAM,EAAE,SAAS,EAAoB,MAAM,uBAAuB,CAAC;AAKzH;;GAEG;AACH,cAAM,aAAa;aACW,QAAQ,EAAE,MAAM;aAC1B,YAAY,EAAE,MAAM;aACpB,UAAU,EAAE,MAAM;aAClB,SAAS,EAAE,MAAM;aACjB,YAAY,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAC,CAAC;aAC1C,YAAY,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA;KAAC,CAAC;aAC7C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AmChH;;;;;;;;OAQG;IACH,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAClF,KAAK,EAAE;QACL,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC5F;IAwBH;;;;;;;OAOG;IACH,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS;CAqCrF"}
|
|
@@ -6,6 +6,7 @@ const tvAccessory_1 = require("./tvAccessory");
|
|
|
6
6
|
const core_sdk_1 = require("@smartthings/core-sdk");
|
|
7
7
|
const switchAccessory_1 = require("./switchAccessory");
|
|
8
8
|
const sliderAccessory_1 = require("./sliderAccessory");
|
|
9
|
+
const soundbarAccessory_1 = require("./soundbarAccessory");
|
|
9
10
|
/**
|
|
10
11
|
* Class implements the configured Device to mac and ip address mappings.
|
|
11
12
|
*/
|
|
@@ -99,6 +100,9 @@ class SmartThingsPlatform {
|
|
|
99
100
|
case 'x.com.st.d.monitor':
|
|
100
101
|
await this.registerTvDevice(client, device, deviceMappings.find(mapping => mapping.deviceId === device.deviceId));
|
|
101
102
|
break;
|
|
103
|
+
case 'oic.d.networkaudio':
|
|
104
|
+
await this.registerSoundbarDevice(client, device, deviceMappings.find(mapping => mapping.deviceId === device.deviceId));
|
|
105
|
+
break;
|
|
102
106
|
default:
|
|
103
107
|
this.log.debug('Ignoring SmartThings device %s because device type %s is not implemented: %s', device.name ? device.name + ' (' + device.deviceId + ')' : device.deviceId, (_b = device.ocf) === null || _b === void 0 ? void 0 : _b.ocfDeviceType, JSON.stringify(device, null, 2));
|
|
104
108
|
break;
|
|
@@ -114,7 +118,7 @@ class SmartThingsPlatform {
|
|
|
114
118
|
*/
|
|
115
119
|
async registerTvDevice(client, device, deviceMapping) {
|
|
116
120
|
var _a, _b, _c, _d, _e, _f;
|
|
117
|
-
this.log.info('Adding new accessory: %s', device.name ? device.name + ' (' + device.deviceId + ')' : device.deviceId);
|
|
121
|
+
this.log.info('Adding new TV accessory: %s', device.name ? device.name + ' (' + device.deviceId + ')' : device.deviceId);
|
|
118
122
|
const component = (_a = device.components) === null || _a === void 0 ? void 0 : _a.at(0);
|
|
119
123
|
if (!component) {
|
|
120
124
|
this.log.info('Can\'t register TV accessory because (main) component does not exist');
|
|
@@ -152,6 +156,37 @@ class SmartThingsPlatform {
|
|
|
152
156
|
}
|
|
153
157
|
}
|
|
154
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* Registers a SmartThings Soundbar Device for Homebridge.
|
|
161
|
+
*
|
|
162
|
+
* @param client the SmartThingsClient used to send API calls
|
|
163
|
+
* @param device the SmartThings Device
|
|
164
|
+
* @param accessory the cached PlatformAccessory or undefined if no cached PlatformAccessory exists
|
|
165
|
+
* @param deviceMappings the array of configured DeviceMapping
|
|
166
|
+
*/
|
|
167
|
+
async registerSoundbarDevice(client, device, deviceMapping) {
|
|
168
|
+
var _a, _b, _c, _d, _e;
|
|
169
|
+
this.log.info('Adding new soundbar accessory: %s', device.name ? device.name + ' (' + device.deviceId + ')' : device.deviceId);
|
|
170
|
+
const component = (_a = device.components) === null || _a === void 0 ? void 0 : _a.at(0);
|
|
171
|
+
if (!component) {
|
|
172
|
+
this.log.info('Can\'t register soundbar accessory because (main) component does not exist');
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
let displayName = (_b = device.name) !== null && _b !== void 0 ? _b : device.deviceId;
|
|
176
|
+
if (deviceMapping === null || deviceMapping === void 0 ? void 0 : deviceMapping.nameOverride) {
|
|
177
|
+
this.log.info('Overriding device default name \'%s\' with configured display name \'%s\'', device.name, deviceMapping.nameOverride);
|
|
178
|
+
displayName = deviceMapping.nameOverride;
|
|
179
|
+
}
|
|
180
|
+
const accessory = new this.api.platformAccessory(displayName, device.deviceId);
|
|
181
|
+
accessory.context.device = device;
|
|
182
|
+
accessory.category = 31 /* this.api.hap.Categories.TELEVISION */;
|
|
183
|
+
this.api.publishExternalAccessories(settings_1.PLUGIN_NAME, [accessory]);
|
|
184
|
+
const tv = new soundbarAccessory_1.SoundbarAccessory(displayName, device, component, client, this.log, this, accessory, (_c = this.config.capabilityLogging) !== null && _c !== void 0 ? _c : false, (_d = this.config.pollInterval) !== null && _d !== void 0 ? _d : undefined, (_e = this.config.cyclicCallsLogging) !== null && _e !== void 0 ? _e : false, deviceMapping === null || deviceMapping === void 0 ? void 0 : deviceMapping.macAddress, deviceMapping === null || deviceMapping === void 0 ? void 0 : deviceMapping.ipAddress, deviceMapping === null || deviceMapping === void 0 ? void 0 : deviceMapping.inputSources);
|
|
185
|
+
await tv.registerCapabilities();
|
|
186
|
+
if (this.config.registerVolumeSlider) {
|
|
187
|
+
this.registerVolumeSlider(client, device, component);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
155
190
|
/**
|
|
156
191
|
* Register the modes of the device passed in as platform accessories.
|
|
157
192
|
* Handles caching of accessories as well.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartThingsPlatform.js","sourceRoot":"","sources":["../src/smartThingsPlatform.ts"],"names":[],"mappings":";;;AAWA,yCAAwD;AACxD,+CAA4C;AAC5C,oDAAyH;AACzH,uDAAoD;AACpD,uDAAoD;
|
|
1
|
+
{"version":3,"file":"smartThingsPlatform.js","sourceRoot":"","sources":["../src/smartThingsPlatform.ts"],"names":[],"mappings":";;;AAWA,yCAAwD;AACxD,+CAA4C;AAC5C,oDAAyH;AACzH,uDAAoD;AACpD,uDAAoD;AACpD,2DAAwD;AAExD;;GAEG;AACH,MAAM,aAAa;IACjB,YAA4B,QAAgB,EAC1B,YAAoB,EACpB,UAAkB,EAClB,SAAiB,EACjB,YAA0C,EAC1C,YAA6C,EAC7C,OAAe;QANL,aAAQ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
1
|
+
import { PlatformAccessory, Logger } from 'homebridge';
|
|
2
|
+
import { SmartThingsPlatform } from './smartThingsPlatform';
|
|
3
|
+
import { SmartThingsClient, Device, Component } from '@smartthings/core-sdk';
|
|
4
|
+
import { SmartThingsAccessory } from './smartThingsAccessory';
|
|
5
|
+
/**
|
|
6
|
+
* Class implements a SmartThings soundbar accessory.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SoundbarAccessory extends SmartThingsAccessory {
|
|
9
|
+
private readonly logCapabilities;
|
|
10
|
+
private readonly pollingInterval;
|
|
11
|
+
private readonly cyclicCallsLogging;
|
|
12
|
+
private readonly macAddress;
|
|
13
|
+
private readonly ipAddress;
|
|
14
|
+
private readonly inputSources;
|
|
15
|
+
private service;
|
|
16
|
+
private speakerService;
|
|
17
|
+
private inputSourceServices;
|
|
18
|
+
private capabilities;
|
|
19
|
+
private activeIdentifierChangeTime;
|
|
20
|
+
private activeIdentifierChangeValue;
|
|
21
|
+
constructor(name: string, device: Device, component: Component, client: SmartThingsClient, log: Logger, platform: SmartThingsPlatform, accessory: PlatformAccessory, logCapabilities: boolean, pollingInterval: number | undefined, cyclicCallsLogging: boolean, macAddress?: string | undefined, ipAddress?: string | undefined, inputSources?: [{
|
|
22
|
+
name: string;
|
|
23
|
+
id: string;
|
|
24
|
+
}] | undefined);
|
|
25
|
+
/**
|
|
26
|
+
* Registers all available capabilities of the SmartThings Component.
|
|
27
|
+
*/
|
|
28
|
+
registerCapabilities(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Registers the SmartThings Capablity if it's functionality is implemented.
|
|
31
|
+
*
|
|
32
|
+
* @param capability the Capability
|
|
33
|
+
*/
|
|
34
|
+
private registerCapability;
|
|
35
|
+
/**
|
|
36
|
+
* Setter for Homebridge accessory Active property.
|
|
37
|
+
*
|
|
38
|
+
* @param value the CharacteristicValue
|
|
39
|
+
*/
|
|
40
|
+
private setActive;
|
|
41
|
+
/**
|
|
42
|
+
* Getter for Homebridge accessory Active property.
|
|
43
|
+
*
|
|
44
|
+
* @param log flag to turn logging on/off
|
|
45
|
+
* @returns the CharacteristicValue
|
|
46
|
+
*/
|
|
47
|
+
private getActive;
|
|
48
|
+
/**
|
|
49
|
+
* Setter for Homebridge accessory VolumeSelector property.
|
|
50
|
+
*
|
|
51
|
+
* @param value the CharacteristicValue
|
|
52
|
+
*/
|
|
53
|
+
private setVolumeSelector;
|
|
54
|
+
/**
|
|
55
|
+
* Setter for Homebridge accessory Volume property.
|
|
56
|
+
*
|
|
57
|
+
* @param value the CharacteristicValue
|
|
58
|
+
*/
|
|
59
|
+
private setVolume;
|
|
60
|
+
/**
|
|
61
|
+
* Getter for Homebridge accessory Volume property.
|
|
62
|
+
*
|
|
63
|
+
* @param log flag to turn logging on/off
|
|
64
|
+
* @returns the CharacteristicValue
|
|
65
|
+
*/
|
|
66
|
+
private getVolume;
|
|
67
|
+
/**
|
|
68
|
+
* Setter for Homebridge accessory Mute property.
|
|
69
|
+
*
|
|
70
|
+
* @param value the CharacteristicValue
|
|
71
|
+
*/
|
|
72
|
+
private setMute;
|
|
73
|
+
/**
|
|
74
|
+
* Getter for Homebridge accessory Mute property.
|
|
75
|
+
*
|
|
76
|
+
* @param log flag to turn logging on/off
|
|
77
|
+
* @returns the CharacteristicValue
|
|
78
|
+
*/
|
|
79
|
+
private getMute;
|
|
80
|
+
/**
|
|
81
|
+
* Setter for Homebridge accessory ActiveIdentifier property.
|
|
82
|
+
*
|
|
83
|
+
* @param value the CharacteristicValue
|
|
84
|
+
*/
|
|
85
|
+
private setActiveIdentifier;
|
|
86
|
+
/**
|
|
87
|
+
* Getter for Homebridge accessory ActiveIdentifier property.
|
|
88
|
+
*
|
|
89
|
+
* @param log flag to turn logging on/off
|
|
90
|
+
* @returns the CharacteristicValue
|
|
91
|
+
*/
|
|
92
|
+
private getActiveIdentifier;
|
|
93
|
+
/**
|
|
94
|
+
* Setter for Homebridge accessory RemoteKey property.
|
|
95
|
+
*
|
|
96
|
+
* @param value the CharacteristicValue
|
|
97
|
+
*/
|
|
98
|
+
private setRemoteKey;
|
|
99
|
+
/**
|
|
100
|
+
* Validates that the SmartThings Capability needed to execute the remote key is available.
|
|
101
|
+
*
|
|
102
|
+
* @param capabilityId the identifier of the SmartThings Capablity
|
|
103
|
+
* @param remoteKey the remote key
|
|
104
|
+
* @returns TRUE in case capability is available - FALSE otherwise
|
|
105
|
+
*/
|
|
106
|
+
private validateRemoteKeyCapability;
|
|
107
|
+
/**
|
|
108
|
+
* Registers all available media input sources (e.g. HDMI inputs).
|
|
109
|
+
*/
|
|
110
|
+
private registerAvailableInputSources;
|
|
111
|
+
/**
|
|
112
|
+
* Registers a Homebridge input source.
|
|
113
|
+
*
|
|
114
|
+
* @param id the input source id
|
|
115
|
+
* @param name the input source display name
|
|
116
|
+
* @param inputSource the InputSourceType or @code undefined @endcode to use @link guessInputSourceType @endlink
|
|
117
|
+
* to determine InputSourceType
|
|
118
|
+
*/
|
|
119
|
+
private registerInputSource;
|
|
120
|
+
/**
|
|
121
|
+
* Guesses the InputSourceType from the identifier of the input source.
|
|
122
|
+
*
|
|
123
|
+
* @param inputSourceId the identifier of the input source
|
|
124
|
+
* @returns the InputSourceType (HDMI|TUNER|OTHER)
|
|
125
|
+
*/
|
|
126
|
+
private guessInputSourceType;
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=soundbarAccessory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"soundbarAccessory.d.ts","sourceRoot":"","sources":["../src/soundbarAccessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAuB,MAAM,EAAE,MAAM,YAAY,CAAC;AAErF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,SAAS,EAAc,MAAM,uBAAuB,CAAC;AAGzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;GAEG;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;IAyBjC;;;;OAIG;YACW,YAAY;IAkC1B;;;;;;OAMG;IACH,OAAO,CAAC,2BAA2B;IASnC;;OAEG;YACW,6BAA6B;IAqB3C;;;;;;;OAOG;IACH,OAAO,CAAC,mBAAmB;IAsB3B;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;CAO7B"}
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SoundbarAccessory = void 0;
|
|
7
|
+
const wol_1 = require("wol");
|
|
8
|
+
const ping_1 = __importDefault(require("ping"));
|
|
9
|
+
const smartThingsAccessory_1 = require("./smartThingsAccessory");
|
|
10
|
+
/**
|
|
11
|
+
* Class implements a SmartThings soundbar accessory.
|
|
12
|
+
*/
|
|
13
|
+
class SoundbarAccessory extends smartThingsAccessory_1.SmartThingsAccessory {
|
|
14
|
+
constructor(name, device, component, client, log, platform, accessory, logCapabilities, pollingInterval, cyclicCallsLogging, macAddress = undefined, ipAddress = undefined, inputSources = undefined) {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
super(device, component, client, platform, accessory, log);
|
|
17
|
+
this.logCapabilities = logCapabilities;
|
|
18
|
+
this.pollingInterval = pollingInterval;
|
|
19
|
+
this.cyclicCallsLogging = cyclicCallsLogging;
|
|
20
|
+
this.macAddress = macAddress;
|
|
21
|
+
this.ipAddress = ipAddress;
|
|
22
|
+
this.inputSources = inputSources;
|
|
23
|
+
this.inputSourceServices = [];
|
|
24
|
+
this.capabilities = [];
|
|
25
|
+
this.activeIdentifierChangeTime = 0;
|
|
26
|
+
this.activeIdentifierChangeValue = 0;
|
|
27
|
+
this.accessory.getService(this.platform.Service.AccessoryInformation)
|
|
28
|
+
.setCharacteristic(this.platform.Characteristic.Name, name);
|
|
29
|
+
this.service = (_a = this.accessory.getService(this.platform.Service.Television)) !== null && _a !== void 0 ? _a : this.accessory.addService(this.platform.Service.Television);
|
|
30
|
+
this.service
|
|
31
|
+
.setCharacteristic(this.platform.Characteristic.SleepDiscoveryMode, this.platform.Characteristic.SleepDiscoveryMode.ALWAYS_DISCOVERABLE)
|
|
32
|
+
.setCharacteristic(this.platform.Characteristic.ConfiguredName, name);
|
|
33
|
+
this.service.getCharacteristic(this.platform.Characteristic.RemoteKey)
|
|
34
|
+
.onSet(this.setRemoteKey.bind(this));
|
|
35
|
+
this.speakerService = (_b = this.accessory.getService(this.platform.Service.TelevisionSpeaker)) !== null && _b !== void 0 ? _b : this.accessory.addService(this.platform.Service.TelevisionSpeaker);
|
|
36
|
+
this.service.addLinkedService(this.speakerService);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Registers all available capabilities of the SmartThings Component.
|
|
40
|
+
*/
|
|
41
|
+
async registerCapabilities() {
|
|
42
|
+
var _a;
|
|
43
|
+
this.logInfo('Registering capabilities for component %s', this.component.id);
|
|
44
|
+
for (const reference of this.component.capabilities) {
|
|
45
|
+
await this.registerCapability(await this.client.capabilities.get(reference.id, (_a = reference.version) !== null && _a !== void 0 ? _a : 0));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Registers the SmartThings Capablity if it's functionality is implemented.
|
|
50
|
+
*
|
|
51
|
+
* @param capability the Capability
|
|
52
|
+
*/
|
|
53
|
+
async registerCapability(capability) {
|
|
54
|
+
let inputSourcePollingStarted = false;
|
|
55
|
+
if (this.logCapabilities) {
|
|
56
|
+
this.logDebug('Available capability: %s', JSON.stringify(capability, null, 2));
|
|
57
|
+
}
|
|
58
|
+
if (capability.id && !this.capabilities.includes(capability.id)) {
|
|
59
|
+
this.capabilities.push(capability.id);
|
|
60
|
+
}
|
|
61
|
+
switch (capability.id) {
|
|
62
|
+
case 'switch':
|
|
63
|
+
this.logCapabilityRegistration(capability);
|
|
64
|
+
this.service.getCharacteristic(this.platform.Characteristic.Active)
|
|
65
|
+
.onSet(this.setActive.bind(this))
|
|
66
|
+
.onGet(this.getActive.bind(this));
|
|
67
|
+
this.startStatusPolling(capability.name, this.service, this.platform.Characteristic.Active, this.getActive.bind(this, this.cyclicCallsLogging), this.pollingInterval);
|
|
68
|
+
break;
|
|
69
|
+
case 'audioVolume':
|
|
70
|
+
this.logCapabilityRegistration(capability);
|
|
71
|
+
this.speakerService
|
|
72
|
+
.setCharacteristic(this.platform.Characteristic.Active, this.platform.Characteristic.Active.ACTIVE);
|
|
73
|
+
this.speakerService
|
|
74
|
+
.setCharacteristic(this.platform.Characteristic.VolumeControlType, this.platform.Characteristic.VolumeControlType.ABSOLUTE);
|
|
75
|
+
this.speakerService
|
|
76
|
+
.getCharacteristic(this.platform.Characteristic.Volume)
|
|
77
|
+
.onGet(this.getVolume.bind(this))
|
|
78
|
+
.onSet(this.setVolume.bind(this));
|
|
79
|
+
this.speakerService.getCharacteristic(this.platform.Characteristic.VolumeSelector)
|
|
80
|
+
.onSet(this.setVolumeSelector.bind(this));
|
|
81
|
+
this.startStatusPolling(capability.name, this.speakerService, this.platform.Characteristic.Volume, this.getVolume.bind(this, this.cyclicCallsLogging), this.pollingInterval);
|
|
82
|
+
break;
|
|
83
|
+
case 'audioMute':
|
|
84
|
+
this.logCapabilityRegistration(capability);
|
|
85
|
+
this.speakerService.getCharacteristic(this.platform.Characteristic.Mute)
|
|
86
|
+
.onSet(this.setMute.bind(this))
|
|
87
|
+
.onGet(this.getMute.bind(this));
|
|
88
|
+
this.startStatusPolling(capability.name, this.speakerService, this.platform.Characteristic.Mute, this.getMute.bind(this, this.cyclicCallsLogging), this.pollingInterval);
|
|
89
|
+
break;
|
|
90
|
+
case 'samsungvd.audioInputSource':
|
|
91
|
+
this.logCapabilityRegistration(capability);
|
|
92
|
+
await this.registerAvailableInputSources();
|
|
93
|
+
if (this.inputSourceServices.length > 0) {
|
|
94
|
+
this.service.getCharacteristic(this.platform.Characteristic.ActiveIdentifier)
|
|
95
|
+
.onSet(this.setActiveIdentifier.bind(this))
|
|
96
|
+
.onGet(this.getActiveIdentifier.bind(this));
|
|
97
|
+
if (!inputSourcePollingStarted) {
|
|
98
|
+
inputSourcePollingStarted = true;
|
|
99
|
+
this.startStatusPolling('activeIdentifier', this.service, this.platform.Characteristic.ActiveIdentifier, this.getActiveIdentifier.bind(this, this.cyclicCallsLogging), this.pollingInterval);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Setter for Homebridge accessory Active property.
|
|
107
|
+
*
|
|
108
|
+
* @param value the CharacteristicValue
|
|
109
|
+
*/
|
|
110
|
+
async setActive(value) {
|
|
111
|
+
this.logDebug('Set active to: %s', value);
|
|
112
|
+
if (value) {
|
|
113
|
+
if (this.macAddress) {
|
|
114
|
+
this.logDebug('Use wake-on-lan functionality because mac-address has been configured');
|
|
115
|
+
if (await (0, wol_1.wake)(this.macAddress)) {
|
|
116
|
+
this.logDebug('Successfully woke device');
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
this.logError('Could not wake device - if this error keeps occuring try to disable wake-on-lan functionality');
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
await this.executeCommand('switch', 'on');
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
await this.executeCommand('switch', 'off');
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Getter for Homebridge accessory Active property.
|
|
132
|
+
*
|
|
133
|
+
* @param log flag to turn logging on/off
|
|
134
|
+
* @returns the CharacteristicValue
|
|
135
|
+
*/
|
|
136
|
+
async getActive(log = true) {
|
|
137
|
+
if (this.ipAddress) {
|
|
138
|
+
try {
|
|
139
|
+
const status = await ping_1.default.promise.probe(this.ipAddress);
|
|
140
|
+
if (log) {
|
|
141
|
+
this.logDebug('ping status: %s', status);
|
|
142
|
+
}
|
|
143
|
+
return status === null || status === void 0 ? void 0 : status.alive;
|
|
144
|
+
}
|
|
145
|
+
catch (exc) {
|
|
146
|
+
this.logError('error when pinging device: %s\n\
|
|
147
|
+
ping command fails mostly because of permission issues - falling back to SmartThings API for getting active state', exc);
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const status = await this.getCapabilityStatus('switch', log);
|
|
152
|
+
return (status === null || status === void 0 ? void 0 : status.switch.value) === 'on' ? true : false;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Setter for Homebridge accessory VolumeSelector property.
|
|
156
|
+
*
|
|
157
|
+
* @param value the CharacteristicValue
|
|
158
|
+
*/
|
|
159
|
+
async setVolumeSelector(value) {
|
|
160
|
+
const increment = value === this.platform.Characteristic.VolumeSelector.INCREMENT;
|
|
161
|
+
this.logDebug('%s volume', increment ? 'Increasing' : 'Decreasing');
|
|
162
|
+
await this.executeCommand('audioVolume', increment ? 'volumeUp' : 'volumeDown');
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Setter for Homebridge accessory Volume property.
|
|
166
|
+
*
|
|
167
|
+
* @param value the CharacteristicValue
|
|
168
|
+
*/
|
|
169
|
+
async setVolume(value) {
|
|
170
|
+
this.logDebug('Set volume to: %s', value);
|
|
171
|
+
await this.executeCommand('audioVolume', 'setVolume', [value]);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Getter for Homebridge accessory Volume property.
|
|
175
|
+
*
|
|
176
|
+
* @param log flag to turn logging on/off
|
|
177
|
+
* @returns the CharacteristicValue
|
|
178
|
+
*/
|
|
179
|
+
async getVolume(log = true) {
|
|
180
|
+
const status = await this.getCapabilityStatus('audioVolume', log);
|
|
181
|
+
return status === null || status === void 0 ? void 0 : status.volume.value;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Setter for Homebridge accessory Mute property.
|
|
185
|
+
*
|
|
186
|
+
* @param value the CharacteristicValue
|
|
187
|
+
*/
|
|
188
|
+
async setMute(value) {
|
|
189
|
+
this.logDebug('Set mute to: %s', value);
|
|
190
|
+
await this.executeCommand('audioMute', value ? 'mute' : 'unmute');
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Getter for Homebridge accessory Mute property.
|
|
194
|
+
*
|
|
195
|
+
* @param log flag to turn logging on/off
|
|
196
|
+
* @returns the CharacteristicValue
|
|
197
|
+
*/
|
|
198
|
+
async getMute(log = true) {
|
|
199
|
+
const status = await this.getCapabilityStatus('audioMute', log);
|
|
200
|
+
return (status === null || status === void 0 ? void 0 : status.mute.value) === 'muted' ? true : false;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Setter for Homebridge accessory ActiveIdentifier property.
|
|
204
|
+
*
|
|
205
|
+
* @param value the CharacteristicValue
|
|
206
|
+
*/
|
|
207
|
+
async setActiveIdentifier(value) {
|
|
208
|
+
var _a;
|
|
209
|
+
this.logDebug('Set active identifier to: %s', value);
|
|
210
|
+
const inputSource = this.inputSourceServices[value];
|
|
211
|
+
this.activeIdentifierChangeTime = Date.now();
|
|
212
|
+
this.activeIdentifierChangeValue = value;
|
|
213
|
+
await this.executeCommand('samsungvd.audioInputSource', 'setInputSource', [(_a = inputSource.name) !== null && _a !== void 0 ? _a : '']);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Getter for Homebridge accessory ActiveIdentifier property.
|
|
217
|
+
*
|
|
218
|
+
* @param log flag to turn logging on/off
|
|
219
|
+
* @returns the CharacteristicValue
|
|
220
|
+
*/
|
|
221
|
+
async getActiveIdentifier(log = true) {
|
|
222
|
+
var _a;
|
|
223
|
+
const status = await this.getCapabilityStatus('samsungvd.audioInputSource', log);
|
|
224
|
+
if (Date.parse((_a = status === null || status === void 0 ? void 0 : status.inputSource.timestamp) !== null && _a !== void 0 ? _a : '') > this.activeIdentifierChangeTime) {
|
|
225
|
+
const id = this.inputSourceServices.findIndex(inputSource => inputSource.name === (status === null || status === void 0 ? void 0 : status.inputSource.value));
|
|
226
|
+
if (log) {
|
|
227
|
+
this.logDebug('ActiveIdentifier has been changed on the device - using API result: %s', id);
|
|
228
|
+
}
|
|
229
|
+
if (id < 0) {
|
|
230
|
+
this.logWarn('Could not find input source for name \'%s\' - using first input source \'%s\' as active identifier', status === null || status === void 0 ? void 0 : status.inputSource.value, this.inputSourceServices[0].name);
|
|
231
|
+
return 0;
|
|
232
|
+
}
|
|
233
|
+
return id;
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
if (log) {
|
|
237
|
+
this.logDebug('ActiveIdentifier has not been changed on the device - using temporary result: %s', this.activeIdentifierChangeValue);
|
|
238
|
+
}
|
|
239
|
+
return this.activeIdentifierChangeValue;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Setter for Homebridge accessory RemoteKey property.
|
|
244
|
+
*
|
|
245
|
+
* @param value the CharacteristicValue
|
|
246
|
+
*/
|
|
247
|
+
async setRemoteKey(value) {
|
|
248
|
+
switch (value) {
|
|
249
|
+
case this.platform.Characteristic.RemoteKey.REWIND:
|
|
250
|
+
if (this.validateRemoteKeyCapability('mediaPlayback', 'REWIND')) {
|
|
251
|
+
await this.executeCommand('mediaPlayback', 'rewind');
|
|
252
|
+
}
|
|
253
|
+
break;
|
|
254
|
+
case this.platform.Characteristic.RemoteKey.FAST_FORWARD:
|
|
255
|
+
if (this.validateRemoteKeyCapability('mediaPlayback', 'FAST_FORWARD')) {
|
|
256
|
+
await this.executeCommand('mediaPlayback', 'fastForward');
|
|
257
|
+
}
|
|
258
|
+
break;
|
|
259
|
+
case this.platform.Characteristic.RemoteKey.PLAY_PAUSE:
|
|
260
|
+
if (this.validateRemoteKeyCapability('mediaPlayback', 'PLAY_PAUSE')) {
|
|
261
|
+
await this.executeCommand('mediaPlayback', 'play');
|
|
262
|
+
}
|
|
263
|
+
break;
|
|
264
|
+
case this.platform.Characteristic.RemoteKey.EXIT:
|
|
265
|
+
if (this.validateRemoteKeyCapability('mediaPlayback', 'EXIT')) {
|
|
266
|
+
await this.executeCommand('mediaPlayback', 'stop');
|
|
267
|
+
}
|
|
268
|
+
break;
|
|
269
|
+
case this.platform.Characteristic.RemoteKey.BACK:
|
|
270
|
+
if (this.validateRemoteKeyCapability('mediaPlayback', 'BACK')) {
|
|
271
|
+
await this.executeCommand('mediaPlayback', 'stop');
|
|
272
|
+
}
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Validates that the SmartThings Capability needed to execute the remote key is available.
|
|
278
|
+
*
|
|
279
|
+
* @param capabilityId the identifier of the SmartThings Capablity
|
|
280
|
+
* @param remoteKey the remote key
|
|
281
|
+
* @returns TRUE in case capability is available - FALSE otherwise
|
|
282
|
+
*/
|
|
283
|
+
validateRemoteKeyCapability(capabilityId, remoteKey) {
|
|
284
|
+
if (this.capabilities.includes(capabilityId)) {
|
|
285
|
+
return true;
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
this.logError('can\'t handle RemoteKey %s because %s capability is not available', remoteKey, capabilityId);
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Registers all available media input sources (e.g. HDMI inputs).
|
|
294
|
+
*/
|
|
295
|
+
async registerAvailableInputSources() {
|
|
296
|
+
var _a;
|
|
297
|
+
const status = await this.client.devices.getCapabilityStatus(this.device.deviceId, this.component.id, 'samsungvd.audioInputSource');
|
|
298
|
+
this.logWarn('Status: %s', JSON.stringify(status));
|
|
299
|
+
const supportedInputSources = [...new Set(status.supportedInputSources.value)].map((s) => {
|
|
300
|
+
return {
|
|
301
|
+
name: s,
|
|
302
|
+
id: s,
|
|
303
|
+
};
|
|
304
|
+
});
|
|
305
|
+
if (this.inputSources) {
|
|
306
|
+
this.logInfo('Overriding default input sources map "%s" with custom map "%s"', JSON.stringify(supportedInputSources, null, 2), JSON.stringify(this.inputSources, null, 2));
|
|
307
|
+
}
|
|
308
|
+
for (const inputSource of (_a = this.inputSources) !== null && _a !== void 0 ? _a : supportedInputSources) {
|
|
309
|
+
this.registerInputSource(inputSource.id, inputSource.name);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Registers a Homebridge input source.
|
|
314
|
+
*
|
|
315
|
+
* @param id the input source id
|
|
316
|
+
* @param name the input source display name
|
|
317
|
+
* @param inputSource the InputSourceType or @code undefined @endcode to use @link guessInputSourceType @endlink
|
|
318
|
+
* to determine InputSourceType
|
|
319
|
+
*/
|
|
320
|
+
registerInputSource(id, name, inputSource = undefined) {
|
|
321
|
+
var _a;
|
|
322
|
+
this.logInfo('Registering input source: %s (%s)', name, id);
|
|
323
|
+
let inputSourceType = inputSource;
|
|
324
|
+
if (inputSourceType === undefined) {
|
|
325
|
+
inputSourceType = this.guessInputSourceType(id);
|
|
326
|
+
this.logDebug('Guessed input source type for %s is: %i', name, inputSourceType);
|
|
327
|
+
}
|
|
328
|
+
const inputSourceService = (_a = this.accessory.getService(id)) !== null && _a !== void 0 ? _a : this.accessory.addService(this.platform.Service.InputSource, id, id);
|
|
329
|
+
inputSourceService.name = id;
|
|
330
|
+
inputSourceService
|
|
331
|
+
.setCharacteristic(this.platform.Characteristic.Identifier, this.inputSourceServices.length)
|
|
332
|
+
.setCharacteristic(this.platform.Characteristic.ConfiguredName, name)
|
|
333
|
+
.setCharacteristic(this.platform.Characteristic.IsConfigured, this.platform.Characteristic.IsConfigured.CONFIGURED)
|
|
334
|
+
.setCharacteristic(this.platform.Characteristic.InputSourceType, inputSourceType);
|
|
335
|
+
this.service.addLinkedService(inputSourceService);
|
|
336
|
+
this.inputSourceServices.push(inputSourceService);
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Guesses the InputSourceType from the identifier of the input source.
|
|
340
|
+
*
|
|
341
|
+
* @param inputSourceId the identifier of the input source
|
|
342
|
+
* @returns the InputSourceType (HDMI|TUNER|OTHER)
|
|
343
|
+
*/
|
|
344
|
+
guessInputSourceType(inputSourceId) {
|
|
345
|
+
if (inputSourceId.startsWith('HDMI')) {
|
|
346
|
+
return this.platform.Characteristic.InputSourceType.HDMI;
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
return this.platform.Characteristic.InputSourceType.OTHER;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
exports.SoundbarAccessory = SoundbarAccessory;
|
|
354
|
+
//# sourceMappingURL=soundbarAccessory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"soundbarAccessory.js","sourceRoot":"","sources":["../src/soundbarAccessory.ts"],"names":[],"mappings":";;;;;;AAIA,6BAA2B;AAC3B,gDAAwB;AACxB,iEAA8D;AAE9D;;GAEG;AACH,MAAa,iBAAkB,SAAQ,2CAAoB;IAQzD,YACE,IAAY,EACZ,MAAc,EACd,SAAoB,EACpB,MAAyB,EACzB,GAAW,EACX,QAA6B,EAC7B,SAA4B,EACX,eAAwB,EACxB,eAAmC,EACnC,kBAA2B,EAC3B,aAAiC,SAAS,EAC1C,YAAgC,SAAS,EACzC,eAAyD,SAAS;;QAEnF,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;QAP1C,oBAAe,GAAf,eAAe,CAAS;QACxB,oBAAe,GAAf,eAAe,CAAoB;QACnC,uBAAkB,GAAlB,kBAAkB,CAAS;QAC3B,eAAU,GAAV,UAAU,CAAgC;QAC1C,cAAS,GAAT,SAAS,CAAgC;QACzC,iBAAY,GAAZ,YAAY,CAAsD;QAlB7E,wBAAmB,GAAc,EAAE,CAAC;QACpC,iBAAY,GAAa,EAAE,CAAC;QAC5B,+BAA0B,GAAG,CAAC,CAAC;QAC/B,gCAA2B,GAAG,CAAC,CAAC;QAmBtC,IAAI,CAAC,SAAS,CAAC,UAAU,CA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|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "Homebridge SmartThings TV",
|
|
3
3
|
"name": "@o-lukas/homebridge-smartthings-tv",
|
|
4
|
-
"version": "2.1
|
|
4
|
+
"version": "2.2.0-next.1",
|
|
5
5
|
"description": "This is a plugin for Homebridge. It offers some basic functions to control Samsung TVs using the SmartThings API.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -60,7 +60,11 @@
|
|
|
60
60
|
},
|
|
61
61
|
"release": {
|
|
62
62
|
"branches": [
|
|
63
|
-
"main"
|
|
63
|
+
"main",
|
|
64
|
+
{
|
|
65
|
+
"name": "next",
|
|
66
|
+
"prerelease": true
|
|
67
|
+
}
|
|
64
68
|
]
|
|
65
69
|
}
|
|
66
70
|
}
|