homebridge-eosstb 2.4.0-alpha.36 → 2.4.0-alpha.38

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/index.js +15 -10
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -42,6 +42,14 @@ Channel name: overwrite not allowed - can we disable in HomeKit. Yes, but preven
42
42
  CHALLENGE
43
43
  The mostWatchedChannelList is not working
44
44
 
45
+ ## 2.4.0-alpha.38 (2026-03-07)
46
+
47
+ - changes to settargetmediastate & setMediaState
48
+
49
+ ## 2.4.0-alpha.37 (2026-03-07)
50
+
51
+ - changes to settargetmediastate
52
+
45
53
  ## 2.4.0-alpha.36 (2026-03-07)
46
54
 
47
55
  - changes to settargetmediastate
package/index.js CHANGED
@@ -5137,20 +5137,21 @@ class StbPlatform {
5137
5137
  }
5138
5138
 
5139
5139
  // set the media state of the settopbox via mqtt
5140
- // controlled by speed
5141
- // speed can be one of: -64 -30 -6 -2 0 2 6 30 64. 0=Paused, 1=Play, >1=FastForward, <0=Rewind
5142
- setMediaState(deviceId, deviceName, channelId, speed) {
5140
+ // media state is controlled by speedRate
5141
+ // speedRate can be one of: -64 -30 -6 -2 0 2 6 30 64. 0=Paused, 1=Play, >1=FastForward, <0=Rewind
5142
+ setMediaState(deviceId, deviceName, channelId, speedRate) {
5143
5143
  try {
5144
5144
  if (this.debugLevel > 0) {
5145
5145
  this.log.warn(
5146
5146
  "setMediaState: set state to %s for channelId %s on %s %s",
5147
- speed,
5147
+ speedRate,
5148
5148
  channelId,
5149
5149
  deviceId,
5150
5150
  deviceName,
5151
5151
  );
5152
5152
  }
5153
5153
  if (this.mqttUsername) {
5154
+ const topic = `${this.mqttUsername}/${deviceId}`;
5154
5155
  const payload = JSON.stringify({
5155
5156
  id: randomUUID(),
5156
5157
  type: "CPE.pushToTV",
@@ -5162,10 +5163,14 @@ class StbPlatform {
5162
5163
  sourceType: "linear",
5163
5164
  source: { channelId },
5164
5165
  relativePosition: 0,
5165
- speed: 1,
5166
+ speed: speedRate,
5166
5167
  },
5167
5168
  });
5168
- this.mqttPublishMessage(`${this.mqttUsername}/${deviceId}`, payload, {
5169
+ if (this.debugLevel > 0) {
5170
+ this.log.warn("setMediaState: publishing to topic:", topic);
5171
+ }
5172
+ this.log.warn(payload);
5173
+ this.mqttPublishMessage(topic, payload, {
5169
5174
  qos: 2,
5170
5175
  retain: true,
5171
5176
  });
@@ -8187,14 +8192,12 @@ class StbDevice {
8187
8192
  // logChangeOnly = TRUE: only the changes are logged, no media state change occurs. Needed when sending remote keypresses to prevent double commands
8188
8193
  // CHAR_NAMES: TargetMediaState: [ 'UUID', 'PLAY', 'PAUSE', 'STOP' ]
8189
8194
  //if (this.debugLevel > 1) {
8190
- this.log.warn(
8195
+ this.log.info(
8191
8196
  "%s: setTargetMediaState to %s [%s]",
8192
8197
  this.name,
8193
8198
  targetMediaState,
8194
8199
  CHAR_NAMES.TargetMediaState[targetMediaState + 1],
8195
8200
  );
8196
-
8197
- this.log(CHAR_NAMES)
8198
8201
  // }
8199
8202
 
8200
8203
  if (!logChangeOnly) {
@@ -8209,13 +8212,14 @@ class StbDevice {
8209
8212
  // PAUSE 1 - 0 Paused
8210
8213
  // STOP 2 - 0 Paused
8211
8214
  const newBoxMediaState = targetMediaState === Characteristic.TargetMediaState.PLAY ? 1 : 0;
8215
+ const newBoxMediaStateName = newBoxMediaState === 1 ? "Play" : "Paused";
8212
8216
 
8213
8217
  //if (this.debugLevel >= 0) {
8214
8218
  this.log(
8215
8219
  "%s: setTargetMediaState: Calling setMediaState with newBoxMediaState %s [%s]",
8216
8220
  this.name,
8217
8221
  newBoxMediaState,
8218
- CHAR_NAMES.TargetMediaState[targetMediaState + 1],
8222
+ newBoxMediaStateName,
8219
8223
  );
8220
8224
  //}
8221
8225
  /*
@@ -8233,6 +8237,7 @@ class StbDevice {
8233
8237
  }
8234
8238
  */
8235
8239
  // send the requested media state to the box
8240
+ // setMediaState 0 will start playing if paused (1)
8236
8241
  this.platform.setMediaState(
8237
8242
  this.deviceId,
8238
8243
  this.name,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "displayName": "Homebridge EOSSTB",
4
4
  "description": "Add your set-top box to Homekit (for Telenet BE, Sunrise CH, UPC SK, Virgin Media GB & IE, Ziggo NL)",
5
5
  "author": "Jochen Siegenthaler (https://github.com/jsiegenthaler/)",
6
- "version": "2.4.0-alpha.36",
6
+ "version": "2.4.0-alpha.38",
7
7
  "platformname": "eosstb",
8
8
  "dependencies": {
9
9
  "axios": "^1.13.6",