garaga page 6
This commit is contained in:
@@ -102,12 +102,14 @@ class HomeAutomationClient {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
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)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user