grzegorz914/homebridge-lgwebos-tv

Version 3.1.6 crashes on startup only when TV is off

vfontes opened this issue · 0 comments

I was only able to reproduce this in 3.1.6; it seems like 3.1.1 and below are not affected.

Here's the debug logs when the TV is off and the plugin starts:

[9/9/2024, 10:39:48 AM] [homebridge-lgwebos-tv] Process Ended. Code: 1, Signal: null
[9/9/2024, 10:39:55 AM] [homebridge-lgwebos-tv] Restarting Process...
[9/9/2024, 10:39:55 AM] [homebridge-lgwebos-tv] Launched child bridge with PID 4873
[9/9/2024, 10:39:56 AM] Registering platform 'homebridge-lgwebos-tv.LgWebOsTv'
[9/9/2024, 10:39:56 AM] [homebridge-lgwebos-tv] Loaded homebridge-lgwebos-tv v3.1.6 child bridge successfully
[9/9/2024, 10:39:56 AM] Loaded 0 cached accessories from cachedAccessories.0EC62BC21CCF.
[9/9/2024, 10:39:56 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, did finish launching.
[9/9/2024, 10:39:56 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, Config: {
  "name": "Sala TV",
  "host": "192.168.1.236",
  "mac": "20:17:42:3b:2d:9f",
  "getInputsFromDevice": true,
  "disableLoadDefaultInputs": false,
  "filterSystemApps": true,
  "inputsDisplayOrder": 0,
  "sensorPower": false,
  "sensorPixelRefresh": false,
  "sensorVolume": false,
  "sensorMute": false,
  "sensorInput": false,
  "sensorChannel": false,
  "sensorSoundMode": false,
  "sensorSoundOutput": false,
  "sensorPictureMode": false,
  "sensorScreenOnOff": false,
  "sensorScreenSaver": false,
  "turnScreenOnOff": false,
  "turnScreenSaverOnOff": false,
  "brightnessControl": false,
  "backlightControl": false,
  "contrastControl": false,
  "colorControl": false,
  "pictureModeControl": false,
  "volumeControlNamePrefix": false,
  "volumeControl": 0,
  "soundModeControl": false,
  "soundOutputControl": true,
  "soundOutputs": [
    {
      "name": "ARC",
      "reference": "external_arc",
      "displayType": 2
    }
  ],
  "serviceMenu": false,
  "sslWebSocket": false,
  "disableTvService": false,
  "ezAdjustMenu": false,
  "infoButtonCommand": "MENU",
  "enableDebugMode": true,
  "disableLogInfo": false,
  "disableLogDeviceInfo": false,
  "restFul": {
    "enable": false,
    "debug": false
  },
  "mqtt": {
    "enable": false,
    "debug": false,
    "auth": false,
    "passwd": "removed"
  }
}
[9/9/2024, 10:39:56 AM] Homebridge v1.8.4 (HAP v0.12.2) (homebridge-lgwebos-tv) is running on port 34781.
[9/9/2024, 10:39:56 AM] 

NOTICE TO USERS AND PLUGIN DEVELOPERS
> Homebridge 2.0 is on the way and brings some breaking changes to existing plugins.
> Please visit the following link to learn more about the changes and how to prepare:
> https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[9/9/2024, 10:39:56 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, debug: Read data: {
  "type": "Buffer",
  "data": [
    54,
    97,
    101,
    99,
    100,
    97,
    99,
    100,
    99,
    102,
    52,
    50,
    50,
    102,
    99,
    52,
    97,
    48,
    54,
    97,
    102,
    100,
    97,
    57,
    101,
    48,
    101,
    51,
    99,
    53,
    98,
    52
  ]
}
[9/9/2024, 10:39:56 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, debug: Connecting to socket.
[9/9/2024, 10:39:59 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, debug: Socket connect error: Error: connect EHOSTUNREACH 192.168.1.236:3000.
[9/9/2024, 10:39:59 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, Power: OFF
[9/9/2024, 10:39:59 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, Volume: 0%
[9/9/2024, 10:39:59 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, Mute: ON
[9/9/2024, 10:39:59 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, Brightness: 0%
[9/9/2024, 10:39:59 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, Backlight: 0%
[9/9/2024, 10:39:59 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, Contrast: 0%
[9/9/2024, 10:39:59 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, Color: 0%
[9/9/2024, 10:39:59 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, Picture Mode: Unknown
[9/9/2024, 10:39:59 AM] [homebridge-lgwebos-tv] Device: 192.168.1.236 Sala TV, Sound Mode: Unknown

/var/lib/homebridge/node_modules/homebridge-lgwebos-tv/src/lgwebosdevice.js:550
                                .updateCharacteristic(Characteristic.On, state);
                                 ^
TypeError: Cannot read properties of undefined (reading 'updateCharacteristic')
    at LgWebOsSocket.<anonymous> (/var/lib/homebridge/node_modules/homebridge-lgwebos-tv/src/lgwebosdevice.js:550:34)
    at LgWebOsSocket.emit (node:events:519:28)
    at WebSocket.<anonymous> (/var/lib/homebridge/node_modules/homebridge-lgwebos-tv/src/lgwebossocket.js:770:18)
    at WebSocket.emit (node:events:519:28)
    at WebSocket.<anonymous> (/var/lib/homebridge/node_modules/homebridge-lgwebos-tv/src/lgwebossocket.js:748:20)
    at WebSocket.emit (node:events:519:28)
    at emitErrorAndClose (/var/lib/homebridge/node_modules/homebridge-lgwebos-tv/node_modules/ws/lib/websocket.js:1041:13)
    at ClientRequest.<anonymous> (/var/lib/homebridge/node_modules/homebridge-lgwebos-tv/node_modules/ws/lib/websocket.js:881:5)
    at ClientRequest.emit (node:events:519:28)
    at emitErrorEvent (node:_http_client:108:11)
[9/9/2024, 10:39:59 AM] [homebridge-lgwebos-tv] Child bridge process ended
[9/9/2024, 10:39:59 AM] [homebridge-lgwebos-tv] Process Ended. Code: 1, Signal: null
[9/9/2024, 10:40:06 AM] [homebridge-lgwebos-tv] Restarting Process...