mirror of
https://github.com/oznu/homebridge-unifi-occupancy-sensor.git
synced 2025-01-22 11:18:56 +00:00
poll data
This commit is contained in:
parent
7626b27edf
commit
a0485ac541
6
index.js
6
index.js
@ -46,6 +46,7 @@ class OccupancySensor {
|
||||
|
||||
this.occupancyDetected = Characteristic.OccupancyDetected.OCCUPANCY_NOT_DETECTED
|
||||
this.checkOccupancy()
|
||||
setInterval(this.checkOccupancy, 1800)
|
||||
}
|
||||
|
||||
checkGuest (isGuest) {
|
||||
@ -82,10 +83,7 @@ class OccupancySensor {
|
||||
}
|
||||
|
||||
getOccupancyDetected (callback) {
|
||||
return this.checkOccupancy()
|
||||
.then(() => {
|
||||
return callback(null, this.occupancyDetected)
|
||||
})
|
||||
return callback(null, this.occupancyDetected)
|
||||
}
|
||||
|
||||
setOccupancyDetected (value) {
|
||||
|
Loading…
Reference in New Issue
Block a user