Skip to content

Instantly share code, notes, and snippets.

@krabs-github
Created July 28, 2021 11:40
Show Gist options
  • Save krabs-github/83bfff8f618d7886d1244822ad605ce9 to your computer and use it in GitHub Desktop.
Save krabs-github/83bfff8f618d7886d1244822ad605ce9 to your computer and use it in GitHub Desktop.
[streamdeck update settings] streamdeck update settings
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