garaga page 5
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user