Skip to content

Commit

Permalink
Fix for upgrade from 1.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
hakana committed Mar 26, 2024
1 parent 7ed7177 commit 0d0d764
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Support devices:
-Sonoff SNZB-02 (Square thermometer)
-Sonoff SNZB-02D (Thermometer with display)
-Sonoff SNZB-02P (Round thermometer)
-Sonoff SNZB-04 (Motion detector)
-Sonoff SNZB-03 (Motion detector)
-Sonoff SNZB-04 (Door/window contact)
-Sonoff SNZB-06P (Presence detector)

More devices will be added soon.

6 changes: 6 additions & 0 deletions drivers/SNZB-03/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ class SonoffSNZB04 extends SonoffBase {

super.onNodeInit({zclNode});

//Fix upgrade from 1.0.14
if (this.hasCapability('alarm_contact') === true) {
await this.removeCapability('alarm_contact');
await this.addCapability('alarm_motion');
}

this.zoneStatusChangeNotification = this.zoneStatusChangeNotification.bind(this);

//this.setCapabilityValue('alarm_motion', null).catch(this.error);
Expand Down
6 changes: 6 additions & 0 deletions drivers/SNZB-06P/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ class SonoffSNZB06P extends SonoffBase {

super.onNodeInit({zclNode});

//Fix upgrade from 1.0.14
if (this.hasCapability('alarm_contact') === true) {
await this.removeCapability('alarm_contact');
await this.addCapability('alarm_motion');
}

this.configureAttributeReporting([
{
endpointId: 1,
Expand Down

0 comments on commit 0d0d764

Please sign in to comment.