ESPHome package for the Apollo MTR-1: tracks people on the stairs with the LD2450 radar and streams a lit window to a WLED controller over DDP. The sensor serves a setup wizard that measures the stairs with one walk and stores the setup on the device. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
966 B
JavaScript
30 lines
966 B
JavaScript
// Adds a "Set up Follow-Me" link to ESPHome's stock web page, opening the
|
|
// setup wizard the device serves at /followme. Loaded by the stock page as
|
|
// /0.js (web_server js_include in follow-me.yaml).
|
|
(() => {
|
|
const ID = 'followme-setup-link';
|
|
const add = () => {
|
|
if (document.getElementById(ID)) return;
|
|
const a = document.createElement('a');
|
|
a.id = ID;
|
|
a.href = '/followme';
|
|
a.textContent = 'Set up Follow-Me';
|
|
a.style.cssText = [
|
|
'position:fixed',
|
|
'right:20px',
|
|
'bottom:20px',
|
|
'z-index:9999',
|
|
'padding:10px 16px',
|
|
'background:#0e0e10',
|
|
'color:#ece8df',
|
|
'border:1px solid rgba(236,232,223,.35)',
|
|
'border-radius:3px',
|
|
"font:500 14px/1.2 'IBM Plex Sans',system-ui,sans-serif",
|
|
'text-decoration:none',
|
|
].join(';');
|
|
document.body.appendChild(a);
|
|
};
|
|
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', add);
|
|
else add();
|
|
})();
|