senorshaun / homebridge-radiora2

Lutron RadioRA2 plugin for homebridge
MIT License
10 stars 5 forks source link

Keypad: Cannot convert undefined or null to objectd #15

Closed scottrus closed 2 years ago

scottrus commented 2 years ago

Starting with 1.3.5 Keypads repeatedly crash. Was working in 1.3.4. Config attached.


[2/7/2022, 7:51:13 PM] [homebridge-radiora2] Child bridge process ended
[2/7/2022, 7:51:13 PM] [homebridge-radiora2] Process Ended. Code: 1, Signal: null
[2/7/2022, 7:51:20 PM] [homebridge-radiora2] Restarting Process...
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Launched child bridge with PID 713801
[2/7/2022, 7:51:21 PM] Registering platform 'homebridge-radiora2.RadioRA2'
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Loaded homebridge-radiora2 v1.3.5 child bridge successfully
[2/7/2022, 7:51:21 PM] Loaded 8 cached accessories from cachedAccessories.0E589B7F7307.
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Attempting connection to 192.168.1.200...
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Connecting...
[2/7/2022, 7:51:21 PM] Homebridge v1.4.0 (HAP v0.10.0) (homebridge-radiora2) is running on port 39018.
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Connected to Lutron!
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Loaded fan 'Porch Fan'
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Loaded fan 'Scott's Fan'
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Loaded fan 'Sean's Fan'
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Loaded fan 'Sammy's Fan'
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Loaded fan 'Guest Fan'
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Loaded fan 'Bedroom Fan'
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Loaded fan 'Bonus Room Fan'
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Loaded 7 fan(s)
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Loaded 0 light(s)
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Loaded 0 occupancy sensor(s)

/homebridge/node_modules/homebridge-radiora2/lib/accessories/keypadbutton.js:58
                Object.keys(this.accessory.get).forEach(function(accessoryUuid) {
         ^
TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at KeypadButton.setupListeners (/homebridge/node_modules/homebridge-radiora2/lib/accessories/keypadbutton.js:58:10)
    at new KeypadButton (/homebridge/node_modules/homebridge-radiora2/lib/accessories/keypadbutton.js:19:14)
    at RadioRA2Platform.<anonymous> (/homebridge/node_modules/homebridge-radiora2/index.js:301:54)
    at Array.forEach (<anonymous>)
    at RadioRA2Platform.<anonymous> (/homebridge/node_modules/homebridge-radiora2/index.js:283:26)
    at RadioRa2.emit (node:events:390:28)
    at incomingData (/homebridge/node_modules/homebridge-radiora2/lib/radiora2.js:97:20)
    at Socket.<anonymous> (/homebridge/node_modules/homebridge-radiora2/lib/radiora2.js:27:92)
    at Socket.emit (node:events:390:28)
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Child bridge process ended
[2/7/2022, 7:51:21 PM] [homebridge-radiora2] Process Ended. Code: 1, Signal: null

JSON Config

{
    "platform": "RadioRA2",
    "repeater": "127.0.0.01",
    "username": "username",
    "password": "password",
    "debug": true,
    "keypads": [
        {
            "name": "Phantom Keypad",
            "id": 36,
            "serial": "0a06e488-4595-11ec-81d3-0242ac130003",
            "model": "RR-T15RL-SW",
            "buttons": [
                {
                    "name": "Morning",
                    "id": 6,
                    "led": 86
                }
            ]
        }
    ],
    "fans": [
        {
            "id": 72,
            "name": "Porch Fan",
            "serial": "799fbff5-f506-4916-aa94-787e3081270d",
            "model": "RRD-2ANF",
            "adjustable": true,
            "onvalue": 75
        },
        {
            "id": 79,
            "name": "Scott's Fan",
            "serial": "002483cb-aaef-428c-a14b-dc2b54572ed6",
            "model": "RRD-2ANF",
            "adjustable": true,
            "onvalue": 75
        },
        {
            "id": 81,
            "name": "Sean's Fan",
            "serial": "f030c4c7-6703-4dd2-b9e4-91bb093b1ecd",
            "model": "RRD-2ANF",
            "adjustable": true,
            "onvalue": 75
        },
        {
            "id": 96,
            "name": "Sammy's Fan",
            "serial": "4d5a1baa-cf0d-4f83-8106-afe6570a4f57",
            "model": "RRD-2ANF",
            "adjustable": true,
            "onvalue": 75
        },
        {
            "id": 83,
            "name": "Guest Fan",
            "serial": "b2da03e8-20d3-4145-86c4-78741bef151b",
            "model": "RRD-2ANF",
            "adjustable": true,
            "onvalue": 75
        },
        {
            "id": 88,
            "name": "Bedroom Fan",
            "serial": "b55b36bc-8204-45ea-b84d-2ab2a62d9763",
            "model": "RRD-2ANF",
            "adjustable": true,
            "onvalue": 75
        },
        {
            "id": 98,
            "name": "Bonus Room Fan",
            "serial": "42cdb772-0e6b-43b4-9acf-7ebb6bef5276",
            "model": "RRD-2ANF",
            "adjustable": true,
            "onvalue": 75
        }
    ],
    "_bridge": {
        "username": "xx:xx:xx:xx:xx:xx",
        "port": 39018
    }
}
senorshaun commented 2 years ago

sorry about that. fixed with 1.3.6. I had a left a bad block of code in the version that got published