Created
November 23, 2020 10:26
-
-
Save jellea/909abf1716f4d4ef44855e891f046f07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ssidChangedCallback() | |
newSSID = hs.wifi.currentNetwork() | |
if newSSID ~= lastSSID then | |
hs.alert.show("Wifi Change - Zeroing Volume", 5) | |
hs.audiodevice.defaultOutputDevice():setVolume(0) | |
end | |
lastSSID = newSSID | |
end | |
wifiWatcher = hs.wifi.watcher.new(ssidChangedCallback) | |
wifiWatcher:start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice, muting just the speakers for myself now. Tested with music playing through AirPods — no interruptions whatsoever.
https://gist.github.com/pandrewhk/e781c51c3de7ee47fe8ba3a6c0f3d2a1/revisions