garaga page 6

This commit is contained in:
2025-11-28 07:51:48 +01:00
parent d9139e2693
commit 86409b26f0

View File

@@ -102,12 +102,14 @@ class HomeAutomationClient {
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async setDeviceState(deviceId, type, payload) { async setDeviceState(deviceId, type, payload) {
const requestBody = { type, payload };
console.log('API setDeviceState request:', requestBody);
await fetch(this.api(`/devices/${deviceId}/set`), { await fetch(this.api(`/devices/${deviceId}/set`), {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
body: JSON.stringify({ type, payload }) body: JSON.stringify(requestBody)
}); });
} }