Skip to content

Commit

Permalink
Add support for the Shelly Button1 version 2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexryd committed Jan 12, 2021
1 parent c95ef59 commit dd8c959
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions accessories/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ module.exports = homebridge => {
}
FACTORIES.set('SHBLB-1', ShellyBulbFactory)

/**
* Shelly Button1 factory.
*/
class ShellyButton1Factory extends AccessoryFactory {
get defaultAccessoryType() {
return 'statelessSwitch'
Expand All @@ -199,6 +202,20 @@ module.exports = homebridge => {
}
FACTORIES.set('SHBTN-1', ShellyButton1Factory)

/**
* Shelly Button1 version 2 factory.
*/
class ShellyButton1V2Factory extends AccessoryFactory {
get defaultAccessoryType() {
return 'statelessSwitch'
}

_createAccessory(accessoryType, ...opts) {
return new ShellyButton1StatelessSwitchAccessory(this.device, ...opts)
}
}
FACTORIES.set('SHBTN-2', ShellyButton1V2Factory)

/**
* Shelly Duo factory.
*/
Expand Down

0 comments on commit dd8c959

Please sign in to comment.