Get state of relay on device page

This commit is contained in:
2024-09-25 21:56:54 +02:00
parent 3c2fa18d9a
commit e0f0067e89
6 changed files with 70 additions and 16 deletions

View File

@ -75,4 +75,16 @@ export class RelayApi {
}
return map;
}
/**
* Get the status of a single relay
*/
static async SingleStatus(relay: DeviceRelay): Promise<RelayStatus> {
return (
await APIClient.exec({
method: "GET",
uri: `/relay/${relay.id}/state`,
})
).data;
}
}