garaga page 11
This commit is contained in:
@@ -364,6 +364,9 @@
|
|||||||
// Control card
|
// Control card
|
||||||
renderOutletControls(container, device);
|
renderOutletControls(container, device);
|
||||||
|
|
||||||
|
// State card
|
||||||
|
renderStateDisplay(container, device);
|
||||||
|
|
||||||
// Find and render powermeter
|
// Find and render powermeter
|
||||||
const powermeterDevice = Object.values(devicesData).find(d => d.device_id === 'powermeter_caroutlet');
|
const powermeterDevice = Object.values(devicesData).find(d => d.device_id === 'powermeter_caroutlet');
|
||||||
if (powermeterDevice) {
|
if (powermeterDevice) {
|
||||||
@@ -399,8 +402,13 @@
|
|||||||
|
|
||||||
card.appendChild(controlGroup);
|
card.appendChild(controlGroup);
|
||||||
container.appendChild(card);
|
container.appendChild(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderStateDisplay(container, device) {
|
||||||
// State display as separate card
|
// State display as separate card
|
||||||
|
const state = deviceStates[device.device_id];
|
||||||
|
const currentPower = state?.power === 'on';
|
||||||
|
|
||||||
const stateCard = document.createElement('div');
|
const stateCard = document.createElement('div');
|
||||||
stateCard.className = 'card';
|
stateCard.className = 'card';
|
||||||
stateCard.style.textAlign = 'center';
|
stateCard.style.textAlign = 'center';
|
||||||
|
|||||||
Reference in New Issue
Block a user