change some variable names
parent
f8197e8eb0
commit
2305a0f35c
|
|
@ -296,14 +296,14 @@
|
||||||
const apiKeyInput = document.querySelector("#api-key");
|
const apiKeyInput = document.querySelector("#api-key");
|
||||||
|
|
||||||
const showDelay = document.querySelector("#show-delay");
|
const showDelay = document.querySelector("#show-delay");
|
||||||
let deviceID = "";
|
global deviceID = "";
|
||||||
let delay = "";
|
let delay = "";
|
||||||
let apiKey = "";
|
let apiKey = "";
|
||||||
const unlockUrl = "https://ths.tnet.space/cgi-bin/doorcontrol-cgi/unlock-main.cgi";
|
const unlockUrl = "https://ths.tnet.space/cgi-bin/doorcontrol-cgi/unlock-main.cgi";
|
||||||
|
|
||||||
// make fetch function that calls cgi script with attributes (device id, api key, delay)
|
// make fetch function that calls cgi script with attributes (device id, api key, delay)
|
||||||
const unlockDoor = (deviceID, apiKey, delay) => {
|
const unlockDoor = (dID, aK, d) => {
|
||||||
fetch(`${unlockUrl}?deviceID=${deviceID}&apiKey=${apiKey}&delay=${delay}`)
|
fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => messageContainer.innerHTML = data.message);
|
.then(data => messageContainer.innerHTML = data.message);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue