Skip to content

Commit

Permalink
Fixed tampered state mapping.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Sowen committed Mar 13, 2021
1 parent 27c2e82 commit 9b663e7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.3.7 (2021-03-13)

### Bugfix

- **General**: Fixed tampered state mapping.

## 0.3.6 (2021-03-13)

### Improvements
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-homematicip",
"version": "0.3.6",
"version": "0.3.7",
"description": "Homematic IP plugin for homebridge",
"license": "Apache-2.0",
"author": "Marc Sowen <[email protected]>",
Expand Down
8 changes: 6 additions & 2 deletions src/devices/HmIPContactSensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ export class HmIPContactSensor extends HmIPGenericDevice implements Updateable {
}

handleStatusTamperedGet(callback: CharacteristicGetCallback) {
callback(null, this.sabotage);
callback(null, this.sabotage
? this.platform.Characteristic.StatusTampered.TAMPERED
: this.platform.Characteristic.StatusTampered.NOT_TAMPERED);
}

public updateDevice(hmIPDevice: HmIPDevice, groups: { [key: string]: HmIPGroup }) {
Expand Down Expand Up @@ -99,7 +101,9 @@ export class HmIPContactSensor extends HmIPGenericDevice implements Updateable {
if (sabotageChannel.sabotage != null && sabotageChannel.sabotage !== this.sabotage) {
this.sabotage = sabotageChannel.sabotage;
this.platform.log.info('Sabotage state of %s changed to %s', this.accessory.displayName, this.sabotage);
this.service.updateCharacteristic(this.platform.Characteristic.StatusTampered, this.sabotage);
this.service.updateCharacteristic(this.platform.Characteristic.StatusTampered, this.sabotage
? this.platform.Characteristic.StatusTampered.TAMPERED
: this.platform.Characteristic.StatusTampered.NOT_TAMPERED);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export const PLUGIN_NAME = 'homebridge-homematicip';
/**
* Version to be used in protocol communication
*/
export const PLUGIN_VERSION = '0.3.6';
export const PLUGIN_VERSION = '0.3.7';

0 comments on commit 9b663e7

Please sign in to comment.