timcharper / homebridge-vivint

Integrates Vivint security system with Apple Home
Other
34 stars 34 forks source link

Are these reason for concern...device_set, index and next_tick errors #18

Closed 3ne closed 4 years ago

3ne commented 4 years ago

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)

rogeremmer commented 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.

3ne commented 4 years ago

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.

daymondm commented 4 years ago

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.

3ne commented 4 years ago

@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.

rogeremmer commented 4 years ago

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

rogeremmer commented 4 years ago

Can confirm that this did fix my problem. Thanks!