Created
July 28, 2021 11:40
-
-
Save krabs-github/83bfff8f618d7886d1244822ad605ce9 to your computer and use it in GitHub Desktop.
[streamdeck update settings] streamdeck update settings
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 updateSettings() { | |
if (websocket && websocket.readyState === 1) { | |
let payload = {}; | |
payload.cityName = document.getElementById("cityName").value; | |
payload.frequency = document.getElementById("frequency").value; | |
payload.unit = document.getElementById("unit").value; | |
payload.roundDegree = document.getElementById("roundDegree").value; | |
payload.displayCity = parseInt( | |
document.getElementById("displayCity").value | |
); | |
const json = { | |
event: "setSettings", | |
context: uuid, | |
payload: payload, | |
}; | |
websocket.send(JSON.stringify(json)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment