Skip to content

Commit

Permalink
Motion/Occupancy 'all' sensor fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mfkrause committed Jan 22, 2021
1 parent 8116409 commit af9a058
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions base/all_accessory.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,23 @@ class PeopleProAllAccessory {
}
this.platform = platform;

this.service = new Service.OccupancySensor(this.name);
this.service
.getCharacteristic(Characteristic.OccupancyDetected)
.on('get', this.getState.bind(this));

if (this.type === 'motion') {
this.service = new Service.MotionSensor(this.name);
this.service
.getCharacteristic(Characteristic.MotionDetected)
.on('get', this.getState.bind(this));

this.accessoryService = new Service.AccessoryInformation();
this.accessoryService
.setCharacteristic(Characteristic.Name, this.name)
.setCharacteristic(Characteristic.SerialNumber, (this.name === this.platform.nooneSensorName) ? 'hps-noone' : 'hps-all')
.setCharacteristic(Characteristic.Manufacturer, 'Elgato');
} else {
this.service = new Service.OccupancySensor(this.name);
this.service
.getCharacteristic(Characteristic.OccupancyDetected)
.on('get', this.getState.bind(this));

this.accessoryService = new Service.AccessoryInformation();
this.accessoryService
.setCharacteristic(Characteristic.Name, this.name);
Expand Down

0 comments on commit af9a058

Please sign in to comment.