Hey, everybody.
I am trying to create an alarm clock in an application, but unfortunately there is only one way, through API. I seem to do everything according to the instructions, but I still get an error. Here is a sample of my code:
// Client creation
this.homeyClient = await HomeyAPI.createAppAPI({ homey: this.homey });
// Alarm creation
await this.homeyClient?.alarms.createAlarm({
alarm: {
name: 'New Alarm',
time: '12:20',
enabled: true,
repetition: {
monday: true,
tuesday: false,
wednesday: true,
thursday: false,
friday: true,
saturday: false,
sunday: false,
},
},
}
I always end up getting an error:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot PUT /api/manager/alarms/alarm/</pre>
</body>
</html>
] {
statusCode: 404,
description: null
}
Obviously, I’ve thrown the permission for the API. Does anyone know what could be wrong?
I especially like it: “description: null”