homebridge-eosstb 2.0.0 → 2.0.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/CHANGELOG.md +6 -0
- package/index.js +31 -61
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,12 @@ Please report all bugs and problems.
|
|
|
17
17
|
* Update axios to 1.1.x (once axios runs properly, 1.1.3 has some bugs) See https://github.com/axios/axios
|
|
18
18
|
|
|
19
19
|
|
|
20
|
+
## 2.0.1 (2022-11-19)
|
|
21
|
+
* Increased reliability of mqtt messages by setting QoS
|
|
22
|
+
* Optimised the GB session code
|
|
23
|
+
* Removed some left over debug code
|
|
24
|
+
|
|
25
|
+
|
|
20
26
|
## 2.0.0 (2022-11-14)
|
|
21
27
|
* Rewrote plugin to handle new login sequence and new endpoints following backend changes on 13.10.2022
|
|
22
28
|
* Major startup speed improvements after Homebridge reboot
|
package/index.js
CHANGED
|
@@ -12,7 +12,7 @@ const PLUGIN_VERSION = packagejson.version;
|
|
|
12
12
|
const fs = require('fs');
|
|
13
13
|
const fsPromises = require('fs').promises;
|
|
14
14
|
const path = require('path');
|
|
15
|
-
const debug = require('debug')(
|
|
15
|
+
const debug = require('debug')('eosstb') // https://github.com/debug-js/debug
|
|
16
16
|
|
|
17
17
|
// good exanple of debug usage https://github.com/mqttjs/MQTT.js/blob/main/lib/client.js
|
|
18
18
|
const mqtt = require('mqtt'); // https://github.com/mqttjs
|
|
@@ -192,6 +192,7 @@ function makeId(length) {
|
|
|
192
192
|
};
|
|
193
193
|
|
|
194
194
|
|
|
195
|
+
|
|
195
196
|
// format an id to conform with the web client ids
|
|
196
197
|
// 32 char, lower case, formatted as follows:
|
|
197
198
|
// "d3e9aa58-6ddc-4c1a-b6a4-8fc1526c6f19"
|
|
@@ -342,7 +343,7 @@ class stbPlatform {
|
|
|
342
343
|
//this.api.on('didFinishLaunching', () => {
|
|
343
344
|
this.api.on('didFinishLaunching', async () => {
|
|
344
345
|
if (this.config.debugLevel > 2) { this.log.warn('API event: didFinishLaunching'); }
|
|
345
|
-
this.log('%s
|
|
346
|
+
this.log('%s v%s', PLUGIN_NAME, PLUGIN_VERSION);
|
|
346
347
|
debug('stbPlatform:apievent :: didFinishLaunching')
|
|
347
348
|
|
|
348
349
|
// call the session watchdog to create the session
|
|
@@ -693,7 +694,7 @@ class stbPlatform {
|
|
|
693
694
|
}
|
|
694
695
|
|
|
695
696
|
// get session ch, nl, ie, at
|
|
696
|
-
// using new auth method,
|
|
697
|
+
// using new auth method, as of 13.10.2022
|
|
697
698
|
async getSession() {
|
|
698
699
|
return new Promise((resolve, reject) => {
|
|
699
700
|
this.log('Creating %s session...', PLATFORM_NAME);
|
|
@@ -780,8 +781,6 @@ class stbPlatform {
|
|
|
780
781
|
}
|
|
781
782
|
//this.log('%s %s', errText, (errReason || ''));
|
|
782
783
|
this.log.debug('getSession: error:', error);
|
|
783
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
784
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
785
784
|
reject(errReason); // reject the promise and return the error
|
|
786
785
|
});
|
|
787
786
|
})
|
|
@@ -897,8 +896,6 @@ class stbPlatform {
|
|
|
897
896
|
//this.log.warn('Step 3 of 6: Unable to login: session expired');
|
|
898
897
|
cookieJar.removeAllCookies(); // remove all the locally cached cookies
|
|
899
898
|
reject("Step 3 of 6: Unable to login: session expired"); // reject the promise and return the error
|
|
900
|
-
//currentSessionState = sessionState.DISCONNECTED;; // flag the session as dead
|
|
901
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
902
899
|
} else {
|
|
903
900
|
|
|
904
901
|
// Step 4: # follow redirect url
|
|
@@ -919,23 +916,16 @@ class stbPlatform {
|
|
|
919
916
|
if (!url) { // robustness: fail if url missing
|
|
920
917
|
t//his.log.warn('Step 4 of 6: location url empty!');
|
|
921
918
|
reject("Step 4 of 6: location url empty!"); // reject the promise and return the error
|
|
922
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
923
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
924
|
-
//return false;
|
|
925
919
|
}
|
|
926
920
|
|
|
927
921
|
// look for login_success.html?code=
|
|
928
922
|
if (url.indexOf('login_success.html?code=') < 0 ) { // <0 if not found
|
|
929
923
|
//this.log.warn('Step 4 of 6: Unable to login: wrong credentials');
|
|
930
924
|
reject("Step 4 of 6: Unable to login: wrong credentials"); // reject the promise and return the error
|
|
931
|
-
//currentSessionState = sessionState.DISCONNECTED;; // flag the session as dead
|
|
932
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
933
925
|
} else if (url.indexOf('error=session_expired') > 0 ) {
|
|
934
926
|
//this.log.warn('Step 4 of 6: Unable to login: session expired');
|
|
935
927
|
cookieJar.removeAllCookies(); // remove all the locally cached cookies
|
|
936
928
|
reject("Step 4 of 6: Unable to login: session expired"); // reject the promise and return the error
|
|
937
|
-
//currentSessionState = sessionState.DISCONNECTED;; // flag the session as dead
|
|
938
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
939
929
|
} else {
|
|
940
930
|
|
|
941
931
|
// Step 5: # obtain authorizationCode
|
|
@@ -944,9 +934,6 @@ class stbPlatform {
|
|
|
944
934
|
if (!url) { // robustness: fail if url missing
|
|
945
935
|
//this.log.warn('Step 5 of 6: location url empty!');
|
|
946
936
|
reject("Step 5 of 6: location url empty!"); // reject the promise and return the error
|
|
947
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
948
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
949
|
-
//return false;
|
|
950
937
|
}
|
|
951
938
|
|
|
952
939
|
var codeMatches = url.match(/code=(?:[^&]+)/g)[0].split('=');
|
|
@@ -984,8 +971,6 @@ class stbPlatform {
|
|
|
984
971
|
//this.log.warn("Step 6 of 6: Unable to authorize with oauth code:", error.response.status, error.response.statusText);
|
|
985
972
|
this.log.debug("Step 6 of 6: Unable to authorize with oauth code:",error);
|
|
986
973
|
reject("Step 6 of 6: Step 6 of 6: Unable to authorize with oauth code: " + error.response.status + ' ' + error.response.statusText); // reject the promise and return the error
|
|
987
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
988
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
989
974
|
});
|
|
990
975
|
};
|
|
991
976
|
};
|
|
@@ -995,8 +980,6 @@ class stbPlatform {
|
|
|
995
980
|
//this.log.warn("Step 4 of 6: Unable to oauth authorize:", error.response.status, error.response.statusText);
|
|
996
981
|
this.log.debug("Step 4 of 6: Unable to oauth authorize:",error);
|
|
997
982
|
reject("Step 2 of 6: Step 4 of 6: Unable to oauth authorize: " + error.response.status + ' ' + error.response.statusText); // reject the promise and return the error
|
|
998
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
999
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1000
983
|
});
|
|
1001
984
|
};
|
|
1002
985
|
})
|
|
@@ -1005,9 +988,6 @@ class stbPlatform {
|
|
|
1005
988
|
this.log.debug("Step 3 of 6: Unable to login:",error);
|
|
1006
989
|
this.log("Step 3 of 6: Unable to login:",error);
|
|
1007
990
|
reject("Step 3 of 6: Unable to login: " + error.response.status + ' ' + error.response.statusText); // reject the promise and return the error
|
|
1008
|
-
//this.log.warn("Step 3 of 6: Unable to login:", error.response.status, error.response.statusText);
|
|
1009
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
1010
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1011
991
|
});
|
|
1012
992
|
})
|
|
1013
993
|
// Step 2 http errors
|
|
@@ -1015,8 +995,6 @@ class stbPlatform {
|
|
|
1015
995
|
this.log.debug("Step 2 of 6: Could not get authorizationUri:",error);
|
|
1016
996
|
//this.log.warn("Step 2 of 6: Could not get authorizationUri", error.response.status, error.response.statusText);
|
|
1017
997
|
reject("Step 2 of 6: Could not get authorizationUri: " + error.response.status + ' ' + error.response.statusText); // reject the promise and return the error
|
|
1018
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
1019
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1020
998
|
});
|
|
1021
999
|
})
|
|
1022
1000
|
// Step 1 http errors
|
|
@@ -1028,8 +1006,6 @@ class stbPlatform {
|
|
|
1028
1006
|
}
|
|
1029
1007
|
this.log.debug('Step 1 of 6: getSessionBE: error:', error);
|
|
1030
1008
|
reject("Step 1 of 6: Failed to create BE session: check your internet connection"); // reject the promise and return the error
|
|
1031
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
1032
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1033
1009
|
});
|
|
1034
1010
|
|
|
1035
1011
|
currentSessionState = sessionState.DISCONNECTED;
|
|
@@ -1155,8 +1131,6 @@ class stbPlatform {
|
|
|
1155
1131
|
//this.log.warn('Step 3 of 7: Unable to login: session expired');
|
|
1156
1132
|
cookieJar.removeAllCookies(); // remove all the locally cached cookies
|
|
1157
1133
|
reject('Step 3 of 7: Unable to login: session expired'); // reject the promise and return the error
|
|
1158
|
-
//currentSessionState = sessionState.DISCONNECTED; // flag the session as dead
|
|
1159
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1160
1134
|
} else {
|
|
1161
1135
|
this.log.debug('Step 3 of 7: login successful');
|
|
1162
1136
|
|
|
@@ -1185,26 +1159,24 @@ class stbPlatform {
|
|
|
1185
1159
|
// look for login_success?code=
|
|
1186
1160
|
if (url.indexOf('login_success?code=') < 0 ) { // <0 if not found
|
|
1187
1161
|
//this.log.warn('Step 4 of 7: Unable to login: wrong credentials');
|
|
1188
|
-
//currentSessionState = sessionState.DISCONNECTED;; // flag the session as dead
|
|
1189
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1190
1162
|
reject('Step 4 of 7: Unable to login: wrong credentials'); // reject the promise and return the error
|
|
1191
1163
|
} else if (url.indexOf('error=session_expired') > 0 ) {
|
|
1192
1164
|
//this.log.warn('Step 4 of 7: Unable to login: session expired');
|
|
1193
1165
|
cookieJar.removeAllCookies(); // remove all the locally cached cookies
|
|
1194
1166
|
reject('Step 4 of 7: Unable to login: session expired'); // reject the promise and return the error
|
|
1195
|
-
//currentSessionState = sessionState.DISCONNECTED;; // flag the session as dead
|
|
1196
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1197
1167
|
} else {
|
|
1198
1168
|
|
|
1199
1169
|
// Step 5: # obtain authorizationCode
|
|
1200
1170
|
this.log('Step 5 of 7: extract authorizationCode');
|
|
1171
|
+
/*
|
|
1201
1172
|
url = response.headers.location;
|
|
1202
1173
|
if (!url) { // robustness: fail if url missing
|
|
1203
1174
|
this.log.warn('getSessionGB: Step 5: location url empty!');
|
|
1204
1175
|
currentSessionState = sessionState.DISCONNECTED;
|
|
1205
1176
|
this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1206
1177
|
return false;
|
|
1207
|
-
}
|
|
1178
|
+
}
|
|
1179
|
+
*/
|
|
1208
1180
|
|
|
1209
1181
|
var codeMatches = url.match(/code=(?:[^&]+)/g)[0].split('=');
|
|
1210
1182
|
var authorizationCode = codeMatches[1];
|
|
@@ -1229,7 +1201,6 @@ class stbPlatform {
|
|
|
1229
1201
|
this.log.debug('Step 6 of 7: response.data:',response.data);
|
|
1230
1202
|
|
|
1231
1203
|
auth = response.data;
|
|
1232
|
-
//var refreshToken = auth.refreshToken // cleanup? don't need extra variable here
|
|
1233
1204
|
this.log.debug('Step 6 of 7: refreshToken:',auth.refreshToken);
|
|
1234
1205
|
|
|
1235
1206
|
// Step 7: # get OESP code
|
|
@@ -1251,8 +1222,6 @@ class stbPlatform {
|
|
|
1251
1222
|
// get device data from the session
|
|
1252
1223
|
this.session = response.data;
|
|
1253
1224
|
|
|
1254
|
-
// get device data from the session
|
|
1255
|
-
this.session = response.data;
|
|
1256
1225
|
currentSessionState = sessionState.CONNECTED;
|
|
1257
1226
|
this.currentStatusFault = Characteristic.StatusFault.NO_FAULT;
|
|
1258
1227
|
this.log('Session created');
|
|
@@ -1263,16 +1232,12 @@ class stbPlatform {
|
|
|
1263
1232
|
//this.log.warn("Step 7 of 7: Unable to get OESP token:",error.response.status, error.response.statusText);
|
|
1264
1233
|
this.log.debug("Step 7 of 7: error:",error);
|
|
1265
1234
|
reject("Step 7 of 7: Unable to get OESP token: " + error.response.status + ' ' + error.response.statusText); // reject the promise and return the error
|
|
1266
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
1267
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1268
1235
|
});
|
|
1269
1236
|
})
|
|
1270
1237
|
// Step 6 http errors
|
|
1271
1238
|
.catch(error => {
|
|
1272
1239
|
//this.log.warn("Step 6 of 7: Unable to authorize with oauth code, http error:",error);
|
|
1273
1240
|
reject("Step 6 of 7: Unable to authorize with oauth code, http error: " + error.response.status + ' ' + error.response.statusText); // reject the promise and return the error
|
|
1274
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
1275
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1276
1241
|
});
|
|
1277
1242
|
};
|
|
1278
1243
|
};
|
|
@@ -1282,8 +1247,6 @@ class stbPlatform {
|
|
|
1282
1247
|
//this.log.warn("Step 4 of 7: Unable to oauth authorize:",error.response.status, error.response.statusText);
|
|
1283
1248
|
this.log.debug("Step 4 of 7: error:",error);
|
|
1284
1249
|
reject("Step 4 of 7: Unable to oauth authorize: " + error.response.status + ' ' + error.response.statusText); // reject the promise and return the error
|
|
1285
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
1286
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1287
1250
|
});
|
|
1288
1251
|
};
|
|
1289
1252
|
})
|
|
@@ -1292,8 +1255,6 @@ class stbPlatform {
|
|
|
1292
1255
|
//this.log.warn("Step 3 of 7: Unable to login:",error.response.status, error.response.statusText);
|
|
1293
1256
|
this.log.debug("Step 3 of 7: error:",error);
|
|
1294
1257
|
reject("Step 3 of 7: Unable to login: " + error.response.status + ' ' + error.response.statusText); // reject the promise and return the error
|
|
1295
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
1296
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1297
1258
|
});
|
|
1298
1259
|
})
|
|
1299
1260
|
// Step 2 http errors
|
|
@@ -1301,8 +1262,6 @@ class stbPlatform {
|
|
|
1301
1262
|
//this.log.warn("Step 2 of 7: Unable to get authorizationUri:",error.response.status, error.response.statusText);
|
|
1302
1263
|
this.log.debug("Step 2 of 7: error:",error);
|
|
1303
1264
|
reject("Step 2 of 7: Could not get authorizationUri: " + error.response.status + ' ' + error.response.statusText); // reject the promise and return the error
|
|
1304
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
1305
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1306
1265
|
});
|
|
1307
1266
|
})
|
|
1308
1267
|
// Step 1 http errors
|
|
@@ -1311,8 +1270,6 @@ class stbPlatform {
|
|
|
1311
1270
|
//this.log.warn("Step 1 of 7: Could not get apiAuthorizationUrl:",error.response.status, error.response.statusText);
|
|
1312
1271
|
this.log.debug("Step 1 of 7: error:",error);
|
|
1313
1272
|
reject("Step 1 of 7: Failed to create GB session - check your internet connection"); // reject the promise and return the error
|
|
1314
|
-
//currentSessionState = sessionState.DISCONNECTED;
|
|
1315
|
-
//this.currentStatusFault = Characteristic.StatusFault.GENERAL_FAULT;
|
|
1316
1273
|
});
|
|
1317
1274
|
|
|
1318
1275
|
currentSessionState = sessionState.DISCONNECTED;
|
|
@@ -1859,6 +1816,10 @@ class stbPlatform {
|
|
|
1859
1816
|
// purchaseService and watchlistService are not needed, but add if desired if we want to monitor these services
|
|
1860
1817
|
parent.mqttSubscribeToTopic(mqttUsername + '/purchaseService');
|
|
1861
1818
|
parent.mqttSubscribeToTopic(mqttUsername + '/watchlistService');
|
|
1819
|
+
|
|
1820
|
+
// bookmarkService is not needed
|
|
1821
|
+
//parent.mqttSubscribeToTopic(mqttUsername + '/bookmarkService');
|
|
1822
|
+
|
|
1862
1823
|
//parent.mqttSubscribeToTopic(mqttUsername + '/radioStatus'); // a guess
|
|
1863
1824
|
//parent.mqttSubscribeToTopic(mqttUsername + '/audioStatus'); // a guess
|
|
1864
1825
|
|
|
@@ -2337,10 +2298,11 @@ class stbPlatform {
|
|
|
2337
2298
|
if (this.config.debugLevel > 0) { this.log.warn('setHgoOnlineRunning'); }
|
|
2338
2299
|
if (mqttUsername) {
|
|
2339
2300
|
this.mqttPublishMessage(
|
|
2301
|
+
// the web client uses qos:2, so we should as well
|
|
2340
2302
|
// {"source":"fd29b575-5f2b-49a0-8efe-62a844ac2b40","state":"ONLINE_RUNNING","deviceType":"HGO","mac":"","ipAddress":""}
|
|
2341
2303
|
mqttUsername + '/' + mqttClientId + '/status', // Topic,
|
|
2342
2304
|
'{"source":"' + mqttClientId + '","state":"ONLINE_RUNNING","deviceType":"HGO","mac":"","ipAddress":""}', // Message, Options
|
|
2343
|
-
{ qos:
|
|
2305
|
+
{ qos:2, retain:true } //Options (json object)
|
|
2344
2306
|
);
|
|
2345
2307
|
}
|
|
2346
2308
|
} catch (err) {
|
|
@@ -2358,6 +2320,7 @@ class stbPlatform {
|
|
|
2358
2320
|
this.log('Change channel to %s [%s] on %s %s', channelId, channelName, deviceName, deviceId);
|
|
2359
2321
|
if (mqttUsername) {
|
|
2360
2322
|
this.mqttPublishMessage(
|
|
2323
|
+
// the web client uses qos:2, so we should as well
|
|
2361
2324
|
mqttUsername + '/' + deviceId,
|
|
2362
2325
|
// cannot get radio to work, sourceType is unclear
|
|
2363
2326
|
// [09/11/2022, 12:55:00] [EOSSTB] Processing channel: 518 1001 SV01301 Radio SRF 1
|
|
@@ -2366,9 +2329,10 @@ class stbPlatform {
|
|
|
2366
2329
|
// [09/11/2022, 12:55:00] [EOSSTB] Processing channel: 521 1004 SV01323 Radio SRF 1 BS
|
|
2367
2330
|
'{"id":"' + makeFormattedId(32) + '","type":"CPE.pushToTV","source":{"clientId":"' + mqttClientId
|
|
2368
2331
|
+ '","friendlyDeviceName":"HomeKit"},"status":{"sourceType":"linear","source":{"channelId":"'
|
|
2369
|
-
+ channelId + '"},"relativePosition":0,"speed":1}}'
|
|
2332
|
+
+ channelId + '"},"relativePosition":0,"speed":1}}',
|
|
2370
2333
|
//+ '","friendlyDeviceName":"HomeKit"},"status":{"sourceType":"ott","source":{"channelId":"'
|
|
2371
2334
|
//+ 'SV01301' + '"},"relativePosition":0,"speed":1}}',
|
|
2335
|
+
{ qos:2, retain:true }
|
|
2372
2336
|
);
|
|
2373
2337
|
}
|
|
2374
2338
|
} catch (err) {
|
|
@@ -2385,10 +2349,12 @@ class stbPlatform {
|
|
|
2385
2349
|
if (this.config.debugLevel > 0) { this.log.warn('setMediaState: set state to %s for channelId %s on %s %s', speed, channelId, deviceId, deviceName); }
|
|
2386
2350
|
if (mqttUsername) {
|
|
2387
2351
|
this.mqttPublishMessage(
|
|
2352
|
+
// the web client uses qos:2, so we should as well
|
|
2388
2353
|
mqttUsername + '/' + this.device.deviceId,
|
|
2389
2354
|
'{"id":"' + makeFormattedId(32) + '","type":"CPE.pushToTV","source":{"clientId":"' + mqttClientId
|
|
2390
2355
|
+ '","friendlyDeviceName":"HomeKit"},"status":{"sourceType":"linear","source":{"channelId":"'
|
|
2391
|
-
+ channelId + '"},"relativePosition":0,"speed":' + speed + '}}'
|
|
2356
|
+
+ channelId + '"},"relativePosition":0,"speed":' + speed + '}}',
|
|
2357
|
+
{ qos:2, retain:true }
|
|
2392
2358
|
);
|
|
2393
2359
|
}
|
|
2394
2360
|
} catch (err) {
|
|
@@ -2407,9 +2373,11 @@ class stbPlatform {
|
|
|
2407
2373
|
if (this.config.debugLevel > 0) { this.log.warn('setPlayerPosition: deviceId:', deviceId); }
|
|
2408
2374
|
if (mqttUsername) {
|
|
2409
2375
|
this.mqttPublishMessage(
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2376
|
+
// the web client uses qos:2, so we should as well
|
|
2377
|
+
mqttUsername + '/' + deviceId,
|
|
2378
|
+
'{"id":"' + makeFormattedId(32) + '","type":"CPE.setPlayerPosition","source":{"clientId":"' + mqttClientId
|
|
2379
|
+
+ '","status":{"relativePosition":' + relativePosition + '}}"',
|
|
2380
|
+
{ qos:2, retain:true }
|
|
2413
2381
|
);
|
|
2414
2382
|
}
|
|
2415
2383
|
} catch (err) {
|
|
@@ -2455,10 +2423,11 @@ class stbPlatform {
|
|
|
2455
2423
|
// send the key if not a wait()
|
|
2456
2424
|
if (!keyName.toLowerCase().startsWith('wait(')) {
|
|
2457
2425
|
this.log('sendKey: sending key %s to %s %s', keyName, deviceName, deviceId);
|
|
2458
|
-
|
|
2426
|
+
// the web client uses qos:2, so we should as well
|
|
2459
2427
|
this.mqttPublishMessage(
|
|
2460
2428
|
mqttUsername + '/' + deviceId,
|
|
2461
|
-
'{"id":"' + makeFormattedId(32) + '","type":"CPE.KeyEvent","source":"' + mqttClientId + '","status":{"w3cKey":"' + keyName + '","eventType":"keyDownUp"}}'
|
|
2429
|
+
'{"id":"' + makeFormattedId(32) + '","type":"CPE.KeyEvent","source":"' + mqttClientId + '","status":{"w3cKey":"' + keyName + '","eventType":"keyDownUp"}}',
|
|
2430
|
+
{ qos:2, retain:true }
|
|
2462
2431
|
);
|
|
2463
2432
|
this.log.debug('sendKey: send %s done', keyName);
|
|
2464
2433
|
|
|
@@ -2482,10 +2451,11 @@ class stbPlatform {
|
|
|
2482
2451
|
this.log.warn('getUiStatus deviceId %s', deviceId);
|
|
2483
2452
|
}
|
|
2484
2453
|
if (mqttUsername) {
|
|
2454
|
+
// the web client uses qos:2, so we should as well
|
|
2485
2455
|
this.mqttPublishMessage(
|
|
2486
2456
|
mqttUsername + '/' + deviceId,
|
|
2487
2457
|
'{"source":"' + mqttClientId + '","id":"' + makeFormattedId(32) + '","type":"CPE.getUiStatus","runtimeType":"getUiStatus"}',
|
|
2488
|
-
{ qos:
|
|
2458
|
+
{ qos:2, retain:true }
|
|
2489
2459
|
);
|
|
2490
2460
|
}
|
|
2491
2461
|
} catch (err) {
|
|
@@ -3076,7 +3046,7 @@ class stbDevice {
|
|
|
3076
3046
|
.on('set', (newMediaState, callback) => { this.setTargetMediaState(newMediaState, callback); });
|
|
3077
3047
|
|
|
3078
3048
|
// extra characteristics added here are accessible in Shortcuts and Automations (both personal and home)
|
|
3079
|
-
//
|
|
3049
|
+
// general fault
|
|
3080
3050
|
this.televisionService.getCharacteristic(Characteristic.StatusFault)
|
|
3081
3051
|
.on('get', this.getStatusFault.bind(this));
|
|
3082
3052
|
|
|
@@ -3187,7 +3157,7 @@ class stbDevice {
|
|
|
3187
3157
|
}
|
|
3188
3158
|
|
|
3189
3159
|
// some channels are deliberately hidden, so assign a fictional channelId and disable them
|
|
3190
|
-
if (chName.includes('HIDDEN_')) { // name
|
|
3160
|
+
if (chName.includes('HIDDEN_')) { // name contains 'HIDDEN_'
|
|
3191
3161
|
chId = 'HIDDEN_' + i;
|
|
3192
3162
|
visState = Characteristic.CurrentVisibilityState.HIDDEN;
|
|
3193
3163
|
configState = Characteristic.IsConfigured.NOT_CONFIGURED;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"displayName": "Homebridge EOSSTB",
|
|
4
4
|
"description": "homebridge-plugin - Add your set-top box to Homekit (for Magenta AT, Telenet BE, Sunrise CH, Virgin Media GB & IE, Ziggo NL)",
|
|
5
5
|
"author": "Jochen Siegenthaler (https://github.com/jsiegenthaler/)",
|
|
6
|
-
"version": "2.0.
|
|
6
|
+
"version": "2.0.1",
|
|
7
7
|
"platformname": "eosstb",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"axios-cookiejar-support": "^4.0.3",
|