-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty name prevented devices from being added #41
Comments
@jgrimard I see you reverted the commit fixing this issue - can you tell me more about the reason? |
@balansse I have no way of testing it myself. I only have a base Vivint alarm system with sensors and a couple of zwave outlets linked to it. I was going to have @zackman0010 test it but he got it working by reconnecting the thermostat to his alarm panel. So I didn't want to make any changes without testing first. |
The name came across as empty string |
Hi @zackman0010 From: https://stackoverflow.com/questions/2100758/javascript-or-variable-assignment-explanation The following values are considered falsy in JavaScript. |
Then your change most likely would have worked. The only thing wrong with the response was that name was empty, and supplying a default value would have fixed that. |
I don't think that code would have fixed the issue. I just did a little testing and found that changing that line in device.js doesn't appear to do anything visible. I tried changing it to this, to simulate an empty string coming in:
I got the below output in my logs and my accessories will still all named correctly. I even cleared the accessory cache. No crash at all.
So it looks like the crash is coming from somewhere else. |
Hello there,
I used log.info(data) at line 144 and check what is before the error.
I hope the information can help you a bit. |
After fixing the www. issue described in #37, I was greeted with a new error message.
[9/8/2021, 09:09:39] [Vivint] Error while bootstrapping accessories: AssertionError [ERR_ASSERTION]: Accessories must be created with a non-empty displayName.
at new Accessory (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:400:11)
at new PlatformAccessory (/usr/lib/node_modules/homebridge/src/platformAccessory.ts:70:9)
at Function.createDeviceAccessory (/usr/lib/node_modules/@balansse/homebridge-vivint/lib/device_set.js:147:23)
at /usr/lib/node_modules/@balansse/homebridge-vivint/index.js:55:50
at Array.map ()
at /usr/lib/node_modules/@balansse/homebridge-vivint/index.js:55:20
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: '',
expected: true,
operator: '=='
}
After a bit of investigation, I found that it was the Nest Thermostat. The VivInt update had wiped the Name field, it was showing blank in the app. I had to remove and readd the thermostat to my VivInt account to let it regain its name. However, this one error with the thermostat prevented all other devices being registered by the VivInt plugin. The error message also made it very unclear which device was at fault. Maybe this error could be caught to provide better info?
The text was updated successfully, but these errors were encountered: