diff --git a/trigger.html b/trigger.html index 79d8a16..e1bb019 100644 --- a/trigger.html +++ b/trigger.html @@ -296,14 +296,14 @@ const apiKeyInput = document.querySelector("#api-key"); const showDelay = document.querySelector("#show-delay"); - let deviceID = ""; + global deviceID = ""; let delay = ""; let apiKey = ""; 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) - const unlockDoor = (deviceID, apiKey, delay) => { - fetch(`${unlockUrl}?deviceID=${deviceID}&apiKey=${apiKey}&delay=${delay}`) + const unlockDoor = (dID, aK, d) => { + fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`) .then(response => response.json()) .then(data => messageContainer.innerHTML = data.message); }