garaga page 5

This commit is contained in:
2025-11-28 07:45:15 +01:00
parent 740ac6c9ad
commit d9139e2693

View File

@@ -511,7 +511,8 @@
async function toggleOutlet(deviceId, newState) { async function toggleOutlet(deviceId, newState) {
try { try {
await window.apiClient.setDeviceState(deviceId, { power: newState }); const device = devicesData[deviceId];
await window.apiClient.setDeviceState(deviceId, device.type, { power: newState });
console.log(`Set ${deviceId} to ${newState}`); console.log(`Set ${deviceId} to ${newState}`);
} catch (error) { } catch (error) {
console.error('Error toggling outlet:', error); console.error('Error toggling outlet:', error);