Trying to setup a mute button for my audio system. The Plugin I'm using doesn't have a built-in mute.
The problem I'm having is I want the mute to be a toggle.
So I need to get the current volume level, hit the mute and the volume will change, then I want to hit the mute again and go back to the original volume.
How can I do that in a script?
This is what I have so far:
How can I get the current volume, save it and go back on the second press of the mute button?
The problem I'm having is I want the mute to be a toggle.
So I need to get the current volume level, hit the mute and the volume will change, then I want to hit the mute again and go back to the original volume.
How can I do that in a script?
This is what I have so far:
Code:
Sub MuteTog (ByVal Parms() As String) Dim theDevice As Double Dim curVol As Double theDevice = parms(0) curVol = hs.DeviceValueEx(theDevice) if curVol > 0 then Dim cc as HomeSeerAPI.CAPI.CAPIControl = hs.CAPIGetSingleControl(theDevice, True, "(value)", False, False) cc.ControlValue = 0 Dim cr as HomeSeerAPI.CAPI.CAPIControlResponse = hs.CAPIControlHandler(cc) End if End Sub
Comment