Closed 3ne closed 4 years ago
I am also seeing this error, however I have many accessories in my config. Whenever I try to control a Vivint accessory the homebridge server crashes.
Wish a dev could help out. I’m thinking one of my dimmer switches may be the culprit. I will remove it from the Vivint hub and see.
hi friend, edit device_set.js, and look at line 720. I believe we need to add let self = this, so it should look like this:
super(accessory)
let self = this
let promiseSetter = function(fn) {
let boundDebounced = debounce(fn.bind(self), 500, {
leading: true
})
I helped create the dimmer switch functionality of this plugin but unfortunately I do not have any Vivint compatible dimmer switches to actually test the code.
@daymondm Thank you so much for checking in. That fixed all the issues I was having with the dimmer switches, the garage door, the alarm and the timing out all the devices at times.
I will give this a try later tonight. I have several dimmer switches, so it’s likely this will fix it for me as well
Can confirm that this did fix my problem. Thanks!
I am seeing this error after homebridge starts, should I be concerned? I have no accessories in my config.
[20/12/2019, 16:27:18] [Vivint] Error while bootstrapping accessories [20/12/2019, 16:27:18] [Vivint] ReferenceError: self is not defined at promiseSetter (/usr/local/lib/node_modules/homebridge-vivint-fixed/lib/device_set.js:720:47) at new DimmerSwitch (/usr/local/lib/node_modules/homebridge-vivint-fixed/lib/device_set.js:746:20) at DeviceSet.bindAccessory (/usr/local/lib/node_modules/homebridge-vivint-fixed/lib/device_set.js:50:20) at newAccessories.forEach (/usr/local/lib/node_modules/homebridge-vivint-fixed/index.js:101:59) at Array.forEach ()
at VivintPlatform.Promise.all.then (/usr/local/lib/node_modules/homebridge-vivint-fixed/index.js:101:26)
at process._tickCallback (internal/process/next_tick.js:68:7)