Compare commits

...

2 Commits
0.9.1 ... 0.9.2

Author SHA1 Message Date
08294ca294 started 4
All checks were successful
ci/woodpecker/tag/build/5 Pipeline was successful
ci/woodpecker/tag/build/6 Pipeline was successful
ci/woodpecker/tag/namespace Pipeline was successful
ci/woodpecker/tag/build/4 Pipeline was successful
ci/woodpecker/tag/build/1 Pipeline was successful
ci/woodpecker/tag/build/3 Pipeline was successful
ci/woodpecker/tag/build/7 Pipeline was successful
ci/woodpecker/tag/config Pipeline was successful
ci/woodpecker/tag/build/2 Pipeline was successful
ci/woodpecker/tag/deploy/3 Pipeline was successful
ci/woodpecker/tag/deploy/5 Pipeline was successful
ci/woodpecker/tag/deploy/2 Pipeline was successful
ci/woodpecker/tag/deploy/6 Pipeline was successful
ci/woodpecker/tag/deploy/4 Pipeline was successful
ci/woodpecker/tag/deploy/1 Pipeline was successful
ci/woodpecker/tag/ingress Pipeline was successful
2025-12-09 13:34:41 +01:00
e5eb368dca started 3 2025-12-09 13:00:47 +01:00
2 changed files with 34 additions and 17 deletions

View File

@@ -416,6 +416,7 @@
if (feedbackDevice) { if (feedbackDevice) {
const feedbackSection = document.createElement('div'); const feedbackSection = document.createElement('div');
feedbackSection.className = 'device-section'; feedbackSection.className = 'device-section';
feedbackSection.dataset.deviceId = feedbackDevice.device_id;
renderFeedbackDisplay(feedbackSection, feedbackDevice); renderFeedbackDisplay(feedbackSection, feedbackDevice);
container.appendChild(feedbackSection); container.appendChild(feedbackSection);
} }
@@ -465,19 +466,10 @@
console.log(`Rendering feedback for ${device.device_id}:`, state); console.log(`Rendering feedback for ${device.device_id}:`, state);
const values = Object.values(state || {}); if (state.contact === 'closed') {
const isActive = values.some(v => label.textContent = 'Schütz ✅ eingeschaltet';
v === true ||
v === 'on' ||
v === 1
);
if (values.length === 0) {
label.textContent = 'Kein Status verfügbar';
} else { } else {
label.textContent = isActive label.textContent = 'Schütz 🅾️ ausgeschaltet';
? 'Fahrzeug verbunden'
: 'Kein Fahrzeug verbunden';
} }
controlGroup.appendChild(label); controlGroup.appendChild(label);
@@ -616,12 +608,14 @@
const state = deviceStates[deviceId]; const state = deviceStates[deviceId];
console.log(`Updating UI for ${deviceId}:`, state); console.log(`Updating UI for ${deviceId}:`, state);
switch (device.type) { switch (deviceId) {
case 'relay': case 'power_relay_caroutlet':
case 'outlet':
updateOutletUI(deviceId, state); updateOutletUI(deviceId, state);
break; break;
case 'three_phase_powermeter': case 'sensor_caroutlet':
updateFeedbackDisplay(deviceId, state);
break;
case 'powermeter_caroutlet':
updateThreePhasePowerUI(deviceId, state); updateThreePhasePowerUI(deviceId, state);
break; break;
} }
@@ -652,6 +646,29 @@
} }
} }
function updateFeedbackDisplay(deviceId, state) {
const section = document.querySelector(`[data-device-id="${deviceId}"]`);
if (!section) return;
const label = section.querySelector('.toggle-label');
if (label) {
const isOn = state.contact === 'closed';
label.textContent = isOn ? 'Schütz ✅ eingeschaltet' : 'Schütz 🅾️ ausgeschaltet';
// Update state display in separate card
const cards = section.querySelectorAll('.card');
if (cards.length >= 3) { // Header, Control, State
const stateCard = cards[2];
stateCard.innerHTML = `
<div style="font-size: 18px; font-weight: 600; color: ${isOn ? '#34c759' : '#666'};">
Status: ${isOn ? 'Eingeschaltet' : 'Ausgeschaltet'}
</div>
`;
}
}
}
function updateThreePhasePowerUI(deviceId, state) { function updateThreePhasePowerUI(deviceId, state) {
// Update overview // Update overview
const totalPower = document.getElementById(`total-power-${deviceId}`); const totalPower = document.getElementById(`total-power-${deviceId}`);

View File

@@ -318,7 +318,7 @@ rooms:
icon: icon:
rank: 310 rank: 310
- device_id: sensor_caroutlet - device_id: sensor_caroutlet
title: Kabelstatus title: Schützzustand
icon: 🔌 icon: 🔌
rank: 315 rank: 315
- device_id: powermeter_caroutlet - device_id: powermeter_caroutlet