Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit 14111b9

Browse files
authored
feat: Add /thermostats/heat_cool (#293)
1 parent 1368345 commit 14111b9

File tree

5 files changed

+70
-16
lines changed

5 files changed

+70
-16
lines changed

docs/classes/Seam.md

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/modules.md

Lines changed: 23 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/seam-connect/routes.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ import {
5959
EventGetRequest,
6060
ClientSessionsGetRequest,
6161
ThermostatSetFanModeRequest,
62-
ThermostatOffRequest,
63-
ThermostatCoolRequest,
6462
ThermostatHeatRequest,
63+
ThermostatCoolRequest,
64+
ThermostatOffRequest,
65+
ThermostatHeatCoolRequest,
6566
} from "../types/route-requests"
6667
import {
6768
AccessCodeGenerateCodeResponse,
@@ -632,6 +633,12 @@ export abstract class Routes {
632633
method: "POST",
633634
data: params,
634635
}),
636+
heatCool: (params: ThermostatHeatCoolRequest) =>
637+
this.createActionAttemptAndWait({
638+
url: "/thermostats/heat_cool",
639+
method: "POST",
640+
data: params,
641+
}),
635642
cool: (params: ThermostatCoolRequest) =>
636643
this.createActionAttemptAndWait({
637644
url: "/thermostats/cool",

src/types/route-requests.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,15 @@ export type ThermostatCoolRequest = {
324324
cooling_set_point_fahrenheit?: number
325325
}
326326

327+
export type ThermostatHeatCoolRequest = {
328+
device_id: string
329+
sync?: boolean
330+
heating_set_point_celsius?: number
331+
heating_set_point_fahrenheit?: number
332+
cooling_set_point_celsius?: number
333+
cooling_set_point_fahrenheit?: number
334+
}
335+
327336
export type ThermostatOffRequest = {
328337
device_id: string
329338
sync?: boolean

tests/routes.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,21 @@ test(
479479
},
480480
"{}"
481481
)
482+
test(
483+
testAPIMethod("thermostats.heatCool"),
484+
{
485+
args: (seed) => [
486+
{
487+
device_id: seed.devices.nest.id1,
488+
cooling_set_point_fahrenheit: 60,
489+
heating_set_point_fahrenheit: 70,
490+
},
491+
],
492+
load_devices_from: ["nest"],
493+
modifiesState: true,
494+
},
495+
"{}"
496+
)
482497
test(
483498
testAPIMethod("thermostats.off"),
484499
{

0 commit comments

Comments
 (0)