diff --git a/apps/ui/static/api-client.js b/apps/ui/static/api-client.js index 875bacd..901241f 100644 --- a/apps/ui/static/api-client.js +++ b/apps/ui/static/api-client.js @@ -102,12 +102,14 @@ class HomeAutomationClient { * @returns {Promise} */ async setDeviceState(deviceId, type, payload) { + const requestBody = { type, payload }; + console.log('API setDeviceState request:', requestBody); await fetch(this.api(`/devices/${deviceId}/set`), { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ type, payload }) + body: JSON.stringify(requestBody) }); }