diff --git a/web-bluetooth/sense-peanut/README.md b/web-bluetooth/sense-peanut/README.md index 838f463..fe37f93 100644 --- a/web-bluetooth/sense-peanut/README.md +++ b/web-bluetooth/sense-peanut/README.md @@ -16,16 +16,19 @@ web app. Look at the `index.html` file and update the JavaScript constant const MY_PEANUTS = { '00:A0:50:46:06:1A': { 'color': 'orange', + 'label': '46:06:1A', 'type': 'guard', 'factoryKey': 'e4e7ba283c9e524bc559c51a27f388f0', }, '00:A0:50:0C:11:08': { 'color': 'blue', + 'label': '0C:11:08', 'type': 'thermo', 'factoryKey': '2cd1d05935bfb2138f346bb24b9cbc23', }, '00:A0:50:06:13:18': { 'color': 'green', + 'label': '06:13:18', 'type': 'thermo', 'factoryKey': 'ebaed4451f6e8bcc0f84a8c3d3574a8c', } @@ -35,4 +38,3 @@ const MY_PEANUTS = { You can grab all these useful information from https://sen.se/developers/peanutkeys/ if you already have a Sen.se Developer Account and added your peanut into the official app. - diff --git a/web-bluetooth/sense-peanut/index.html b/web-bluetooth/sense-peanut/index.html index 29912ed..43602ac 100644 --- a/web-bluetooth/sense-peanut/index.html +++ b/web-bluetooth/sense-peanut/index.html @@ -62,16 +62,19 @@ const MY_PEANUTS = { '00:A0:50:46:06:1A': { 'color': 'orange', + 'label': '46:06:1A', 'type': 'guard', 'factoryKey': 'e4e7ba283c9e524bc559c51a27f388f0', }, '00:A0:50:0C:11:08': { 'color': 'blue', + 'label': '0C:11:08', 'type': 'thermo', 'factoryKey': '2cd1d05935bfb2138f346bb24b9cbc23', }, '00:A0:50:06:13:18': { 'color': 'green', + 'label': '06:13:18', 'type': 'thermo', 'factoryKey': 'ebaed4451f6e8bcc0f84a8c3d3574a8c', } @@ -95,6 +98,7 @@ peanut.factoryKey = MY_PEANUTS[macAddress].factoryKey; peanut.mac = macAddress; peanut.type = MY_PEANUTS[macAddress].type; + peanut.label = MY_PEANUTS[macAddress].label; }) .then(_ => peanut.getPlainText()) .then(clearText => peanut.setFactoryCipher(peanut.factoryKey, clearText)) @@ -111,7 +115,7 @@ newButton.classList.add('mdl-button', 'mdl-js-button'); newButton.dataset.mac = peanut.mac; newButton.dataset.color = peanut.color; - newButton.textContent = peanut.mac.substr(9, 8); + newButton.textContent = peanut.label; newButton.addEventListener('click', onConnectButtonClick); $('#buttons').appendChild(newButton); peanut.rgbColor = window.getComputedStyle(newButton).color;