new endpoints 6

This commit is contained in:
2025-11-18 11:02:03 +01:00
parent 3e9e388ddd
commit 3e02decc02

View File

@@ -289,15 +289,14 @@
return; return;
} }
// Load all device states at once // Lade nur die States für die Geräte im aktuellen Raum
// NEW: Use device state endpoint for each device for (const device of roomDevices) {
// Fallback: load all states as before try {
const allStates = await window.apiClient.getAllStates(); deviceStates[device.device_id] = await window.apiClient.getDeviceState(device.device_id);
// Example: For each device in room.devices, you could fetch state via } catch (err) {
// await window.apiClient.getDeviceState(device_id); deviceStates[device.device_id] = null;
roomDevices.forEach(device => { }
deviceStates[device.device_id] = allStates[device.device_id] || null; }
});
// Render devices // Render devices
grid.style.display = 'grid'; grid.style.display = 'grid';