nfarina / homebridge-sonos

Sonos plugin for homebridge: https://github.com/nfarina/homebridge
155 stars 52 forks source link

Switch will mute/unmute instead of play/stop #46

Closed amitgandhinz closed 7 years ago

amitgandhinz commented 7 years ago

Play/Stop doesnt make sense on a Sonos Playbar, and this.device.play will return an error on the Playbar.

This change modifies the switch behavior to instead Mute/Unmute the speaker.

nfarina commented 7 years ago

A simple/dumb solution might be to introduce a config option for muting instead of pausing. Since you have to add one Accessory per room - just add an option like mute: true to the accessory representing your Playbar:

{
  "accessories": [
    {
      "accessory": "Sonos",
      "name": "Living Room Speakers",
      "room": "Living Room",
      "mute": true,
    }
  ]
}
amitgandhinz commented 7 years ago

Thanks for the tip @nfarina . I have added the config option.

nfarina commented 7 years ago

Awesome! Ready to merge?

amitgandhinz commented 7 years ago

Yes sir!