diff --git a/apps/ui/templates/garage.html b/apps/ui/templates/garage.html index 8e7e856..38a5f87 100644 --- a/apps/ui/templates/garage.html +++ b/apps/ui/templates/garage.html @@ -511,7 +511,8 @@ async function toggleOutlet(deviceId, newState) { 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}`); } catch (error) { console.error('Error toggling outlet:', error);