Skip to content
This repository has been archived by the owner on Apr 25, 2021. It is now read-only.

Commit

Permalink
Additional Fixes for homebridge 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ilcato committed Feb 21, 2021
1 parent 098009c commit 3782d1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Look for a sample config in [config.json example](https://github.com/ilcato/home


# Release notes
Version 2.3.9
+ Additional Fixes for homebridge 1.3

Version 2.3.8
+ Fixes for homebridge 1.3

Expand Down
12 changes: 4 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ class FibaroHC2 {
this.setCharacteristicValue(value, callback, context, characteristic, service, IDs);
});
characteristic.on('get', (callback) => {
if (characteristic.UUID == (new Characteristic.Name()).UUID) {
callback(undefined, characteristic.value);
return;
}
if (service.isVirtual && !service.isGlobalVariableSwitch) {
// a push button is normally off
callback(undefined, false);
Expand All @@ -328,10 +332,6 @@ class FibaroHC2 {
this.log("Getting value from device: ", `${IDs[0]} parameter: ${characteristic.displayName}`);
// Manage security system status
if (service.isSecuritySystem) {
if (characteristic.UUID == (new Characteristic.Name()).UUID) {
callback(undefined, characteristic.value);
return;
}
if (!this.fibaroClient) return;
this.fibaroClient.getGlobalVariable("SecuritySystem")
.then((securitySystemStatus) => {
Expand All @@ -345,10 +345,6 @@ class FibaroHC2 {
}
// Manage global variable switches
if (service.isGlobalVariableSwitch) {
if (characteristic.UUID == (new Characteristic.Name()).UUID) {
callback(undefined, characteristic.value);
return;
}
if (!this.fibaroClient) return;
this.fibaroClient.getGlobalVariable(IDs[1])
.then((switchStatus) => {
Expand Down

0 comments on commit 3782d1f

Please sign in to comment.