Skip to content

Commit

Permalink
Merge pull request #33 from ptz0n/poll-contact-sensor
Browse files Browse the repository at this point in the history
Poll for contact sensor state value
  • Loading branch information
ptz0n authored Jun 15, 2018
2 parents fa94d25 + a233622 commit e6390b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion accessories/contactsensor.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ class ContactSensor extends VerisureAccessory {
const { Service, Characteristic } = this.homebridge.hap;

this.service = new Service.ContactSensor(this.name);
this.service
const currentStateCharacteristic = this.service
.getCharacteristic(Characteristic.ContactSensorState)
.on('get', this.getCurrentSensorState.bind(this));

this.pollCharacteristics.push(currentStateCharacteristic);

return [this.accessoryInformation, this.service];
}
}
Expand Down

0 comments on commit e6390b0

Please sign in to comment.