Skip to content

Commit

Permalink
fix(structure): adding in structure set point function
Browse files Browse the repository at this point in the history
  • Loading branch information
bassrock committed Sep 20, 2021
1 parent fed295c commit 6849463
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,25 @@ export class Client {
});
return structure.fromJSON(response.data.data);
}

/**
*
* @param structure
* @param setPointC
* @returns
*/
public async setStructureSetPoint(structure: Structure, setPointC: number): Promise<Structure> {
await this.updateClient();
const response = await this.client.patch(`/api/structures/${structure.id}`, {
data: {
type: 'structures',
attributes: {
'set-point-temperature-c': setPointC,
},
relationships: {},
},
});
structure.fromJSON(response.data.data);
return structure;
}
}

0 comments on commit 6849463

Please sign in to comment.