Skip to content

Commit 6849463

Browse files
committed
fix(structure): adding in structure set point function
1 parent fed295c commit 6849463

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/client.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,4 +349,25 @@ export class Client {
349349
});
350350
return structure.fromJSON(response.data.data);
351351
}
352+
353+
/**
354+
*
355+
* @param structure
356+
* @param setPointC
357+
* @returns
358+
*/
359+
public async setStructureSetPoint(structure: Structure, setPointC: number): Promise<Structure> {
360+
await this.updateClient();
361+
const response = await this.client.patch(`/api/structures/${structure.id}`, {
362+
data: {
363+
type: 'structures',
364+
attributes: {
365+
'set-point-temperature-c': setPointC,
366+
},
367+
relationships: {},
368+
},
369+
});
370+
structure.fromJSON(response.data.data);
371+
return structure;
372+
}
352373
}

0 commit comments

Comments
 (0)