Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

fix: use Promise-based event listener registration #96

Merged
merged 1 commit into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/accessories/leakSensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class LeakSensorAccessory {
// see https://developers.homebridge.io/#/service/LeakSensor
this.service
.getCharacteristic(this.platform.Characteristic.LeakDetected)
.on('get', this.handleLeakDetected.bind(this));
.onGet(this.handleLeakDetected.bind(this));
}

private _getLeakDetectedCharacteristicValue(leak: boolean) {
Expand Down
6 changes: 3 additions & 3 deletions src/accessories/lock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ export class LockAccessory {
// see https://developers.homebridge.io/#/service/LockMechanism
this.service
.getCharacteristic(this.platform.Characteristic.LockCurrentState)
.on('get', this.handleLockCurrentStateGet.bind(this));
.onGet(this.handleLockCurrentStateGet.bind(this));

this.service
.getCharacteristic(this.platform.Characteristic.LockTargetState)
.on('get', this.handleLockTargetStateGet.bind(this))
.on('set', this.handleLockTargetStateSet.bind(this));
.onGet(this.handleLockTargetStateGet.bind(this))
.onSet(this.handleLockTargetStateSet.bind(this));
}

private _getLockStateCharacteristicValue(locked: boolean) {
Expand Down
4 changes: 2 additions & 2 deletions src/accessories/switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export class SwitchAccessory {
// see https://developers.homebridge.io/#/service/Switch
this.service
.getCharacteristic(this.platform.Characteristic.On)
.on('get', this.handleOnGet.bind(this))
.on('set', this.handleOnSet.bind(this));
.onGet(this.handleOnGet.bind(this))
.onSet(this.handleOnSet.bind(this));
}

private static _getOnCharacteristicValue(on: boolean) {
Expand Down