homebridge-yoto 0.0.8 → 0.0.9

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.
@@ -408,6 +408,12 @@ export class YotoPlayerAccessory {
408
408
  return
409
409
  }
410
410
 
411
+ // TEMPORARY: Debug logging for MQTT troubleshooting
412
+ this.log.warn(LOG_PREFIX.ACCESSORY, `[${this.device.name}] MQTT Connection Details:`)
413
+ this.log.warn(LOG_PREFIX.ACCESSORY, ` Device ID: ${this.device.deviceId}`)
414
+ this.log.warn(LOG_PREFIX.ACCESSORY, ` Access Token: ${this.platform.config.accessToken}`)
415
+ this.log.warn(LOG_PREFIX.ACCESSORY, ` Token Length: ${this.platform.config.accessToken.length}`)
416
+
411
417
  // Connect MQTT with device ID and access token
412
418
  await this.mqtt.connect(
413
419
  this.platform.config.accessToken,
package/lib/yotoMqtt.js CHANGED
@@ -65,14 +65,31 @@ export class YotoMqtt {
65
65
  this.log.info(LOG_PREFIX.MQTT, `Connecting to ${this.brokerUrl}...`)
66
66
 
67
67
  const clientId = `homebridge-yoto-${deviceId}-${Date.now()}`
68
+ const username = `${deviceId}?x-amz-customauthorizer-name=${YOTO_MQTT_AUTH_NAME}`
69
+
70
+ // TEMPORARY: Detailed debug logging for MQTT troubleshooting
71
+ this.log.warn(LOG_PREFIX.MQTT, '='.repeat(60))
72
+ this.log.warn(LOG_PREFIX.MQTT, 'MQTT CONNECTION DETAILS')
73
+ this.log.warn(LOG_PREFIX.MQTT, '='.repeat(60))
74
+ this.log.warn(LOG_PREFIX.MQTT, `Broker URL: ${this.brokerUrl}`)
75
+ this.log.warn(LOG_PREFIX.MQTT, `Client ID: ${clientId}`)
76
+ this.log.warn(LOG_PREFIX.MQTT, `Username: ${username}`)
77
+ this.log.warn(LOG_PREFIX.MQTT, `Device ID: ${deviceId}`)
78
+ this.log.warn(LOG_PREFIX.MQTT, `Token: ${accessToken}`)
79
+ this.log.warn(LOG_PREFIX.MQTT, `Token length: ${accessToken.length}`)
80
+ this.log.warn(LOG_PREFIX.MQTT, 'Port: 443')
81
+ this.log.warn(LOG_PREFIX.MQTT, 'Protocol: wss')
82
+ this.log.warn(LOG_PREFIX.MQTT, 'Keepalive: 300')
83
+ this.log.warn(LOG_PREFIX.MQTT, `Connect Timeout: ${MQTT_CONNECT_TIMEOUT}ms`)
84
+ this.log.warn(LOG_PREFIX.MQTT, '='.repeat(60))
68
85
 
69
86
  this.client = mqtt.connect(this.brokerUrl, {
70
87
  keepalive: 300,
71
88
  port: 443,
72
89
  protocol: 'wss',
73
- username: `${deviceId}?x-amz-customauthorizer-name=${YOTO_MQTT_AUTH_NAME}`,
90
+ username,
74
91
  password: accessToken,
75
- reconnectPeriod: MQTT_RECONNECT_PERIOD,
92
+ reconnectPeriod: 0, // Disable auto-reconnect - we'll handle reconnection manually
76
93
  connectTimeout: MQTT_CONNECT_TIMEOUT,
77
94
  clientId,
78
95
  clean: true,
@@ -93,6 +110,7 @@ export class YotoMqtt {
93
110
 
94
111
  this.client.on('error', (error) => {
95
112
  this.log.error(LOG_PREFIX.MQTT, 'Connection error:', error)
113
+ this.log.error(LOG_PREFIX.MQTT, 'Error details:', JSON.stringify(error, null, 2))
96
114
  if (!this.connected) {
97
115
  reject(error)
98
116
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-yoto",
3
3
  "description": "Control your Yoto players through Apple HomeKit with real-time MQTT updates",
4
- "version": "0.0.8",
4
+ "version": "0.0.9",
5
5
  "author": "Bret Comnes <bcomnes@gmail.com> (https://bret.io)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/bcomnes/homebridge-yoto/issues"