senorshaun / homebridge-radiora2

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

Name parameter not working #10

Closed shawnparr closed 2 years ago

shawnparr commented 2 years ago

version 1.3.2, config:

{ "platform": "RadioRA2", "name": "RadioRA2", "repeater": "redacted", "username": "redacted", "password": "redacted", "fans": [ { "name": "Master Bedroom Fan", "id": 18, "adjustable": true, "onvalue": 25 }, { "name": "Den Fan", "id": 35, "adjustable": true, "onvalue": 25 } ], "occupancysensors": [ { "name": "Master Closet Occupancy", "id": 25 } ] }

In the logs I get:

[10/31/2021, 3:45:40 PM] [RadioRA2] Connected to Lutron! (node:2141) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toString' of undefined at new Fan (/homebridge/node_modules/homebridge-radiora2/lib/accessories/fan.js:14:72) at RadioRA2Platform.addFanAccessory (/homebridge/node_modules/homebridge-radiora2/index.js:57:44) at RadioRA2Platform. (/homebridge/node_modules/homebridge-radiora2/index.js:211:30) at Array.forEach () at RadioRA2Platform. (/homebridge/node_modules/homebridge-radiora2/index.js:206:23) at RadioRa2.emit (events.js:400:28) at incomingData (/homebridge/node_modules/homebridge-radiora2/lib/radiora2.js:97:20) at Socket. (/homebridge/node_modules/homebridge-radiora2/lib/radiora2.js:27:92) at Socket.emit (events.js:400:28) at addChunk (internal/streams/readable.js:293:12) (Use node --trace-warnings ... to show where the warning was created) (node:2141) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

If I remove the "name" entries I get the following:

[10/31/2021, 3:52:04 PM] [RadioRA2] Connected to Lutron! [10/31/2021, 3:52:04 PM] [RadioRA2] Invalid fan in config. Not loading it. [10/31/2021, 3:52:04 PM] [RadioRA2] Invalid fan in config. Not loading it. [10/31/2021, 3:52:04 PM] [RadioRA2] Loaded 2 fan(s) [10/31/2021, 3:52:04 PM] [RadioRA2] Loaded 0 light(s) [10/31/2021, 3:52:04 PM] [RadioRA2] Invalid occupancy sensor in config. Not loading it. [10/31/2021, 3:52:04 PM] [RadioRA2] Loaded 1 occupancy sensor(s) [10/31/2021, 3:52:04 PM] [RadioRA2] Loaded 0 keypad(s) [10/31/2021, 3:52:04 PM] [RadioRA2] Loaded 0 visor control receiver(s) [10/31/2021, 3:52:04 PM] [RadioRA2] Loaded 0 HVAC controller(s)

cariacou commented 2 years ago

Could we just have the name be optional, with a default name filled in?

Either Lutron's name / Model Number / Type or Lutron's ID would be good enough. It's easy to rename in HomeKit.