Skip to content

Commit

Permalink
Merge pull request #3 from zswuwing/fix-noResponse
Browse files Browse the repository at this point in the history
Fix no response
  • Loading branch information
zswuwing authored Jun 28, 2023
2 parents 2bc27cb + 7e42393 commit 4f01808
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-wyze-smart-home",
"version": "0.5.26",
"version": "0.5.28",
"description": "Wyze Smart Home plugin for Homebridge",
"license": "MIT",
"main": "src/index.js",
Expand Down
5 changes: 4 additions & 1 deletion src/accessories/WyzeHMS.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const { Service, Characteristic } = require('../types')
const WyzeAccessory = require('./WyzeAccessory')

const noResponse = new Error('No Response')
noResponse.toString = () => { return noResponse.message }

module.exports = class WyzeHMS extends WyzeAccessory {
constructor (plugin, homeKitAccessory) {
super(plugin, homeKitAccessory)
Expand Down Expand Up @@ -120,4 +123,4 @@ module.exports = class WyzeHMS extends WyzeAccessory {
sleep (ms) {
return new Promise(resolve => setTimeout(resolve, ms * 1000))
}
}
}
6 changes: 3 additions & 3 deletions src/accessories/WyzeLock.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const HOMEBRIDGE_BATTERY_CHARACTERISTIC = Characteristic.BatteryLevel
const HOMEBRIDGE_CONTACT_SENSOR_SERVICE = Service.ContactSensor
const HOMEBRIDGE_CONTACT_SENSOR_CHARACTERISTIC = Characteristic.ContactSensorState.CurrentDoorState

//const noResponse = new Error('No Response')
//noResponse.toString = () => { return noResponse.message }
const noResponse = new Error('No Response')
noResponse.toString = () => { return noResponse.message }

module.exports = class WyzeLock extends WyzeAccessory {
constructor (plugin, homeKitAccessory) {
Expand Down Expand Up @@ -124,4 +124,4 @@ module.exports = class WyzeLock extends WyzeAccessory {

checkBatteryVoltage (deviceVoltage) {
if (deviceVoltage >= 100) { return 100 } else if ( deviceVoltage == "undefined") { return 100 } else { return deviceVoltage }}
}
}

0 comments on commit 4f01808

Please sign in to comment.