Skip to content

Commit

Permalink
checkStateWithPing fixed
Browse files Browse the repository at this point in the history
Fixes #256
  • Loading branch information
lprhodes committed Feb 15, 2018
1 parent ae2e397 commit 1a1a879
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion accessories/outlet.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SwitchAccessory extends BroadlinkRMAccessory {

config.resendDataAfterReload = config.resendHexAfterReload;

if (config.pingIPAddress) checkStateWithPing()
if (config.pingIPAddress) self.checkStateWithPing()
}

checkStateWithPing () {
Expand Down
2 changes: 1 addition & 1 deletion accessories/switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SwitchAccessory extends BroadlinkRMAccessory {

config.resendDataAfterReload = config.resendHexAfterReload;

if (config.pingIPAddress) checkStateWithPing()
if (config.pingIPAddress) self.checkStateWithPing()
}

checkStateWithPing () {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-broadlink-rm",
"version": "2.6.7",
"version": "2.6.8",
"description": "Broadlink RM plugin (including the mini and pro) for homebridge: https://github.com/nfarina/homebridge",
"license": "ISC",
"keywords": [
Expand Down

7 comments on commit 1a1a879

@vpolsinelli
Copy link

@vpolsinelli vpolsinelli commented on 1a1a879 Feb 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error TypeError: self.checkStateWithPing is not a function is now given. I believe it should be this instead of self.

Also, ping is not defined.

@lprhodes
Copy link
Owner Author

@lprhodes lprhodes commented on 1a1a879 Feb 15, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vpolsinelli
Copy link

@vpolsinelli vpolsinelli commented on 1a1a879 Feb 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries at all. It happens to me all the time. :) thanks for making this!

@vpolsinelli
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding const ping = require('ping'); to the top fixes the issue.

@theo-69
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where to add this @Vince105

@vpolsinelli
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theo-69 Add it right at the top of the switch.js and outlet.js files with the other const declarations.

@theo-69
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vince105 tried but no luck, waiting for update than :-(

Please sign in to comment.