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

Commit 1d9f5d0

Browse files
authored
feat: Add /thermostats/cool (#291)
1 parent 0249d56 commit 1d9f5d0

File tree

5 files changed

+63
-14
lines changed

5 files changed

+63
-14
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: 21 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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import {
5959
EventGetRequest,
6060
ClientSessionsGetRequest,
6161
ThermostatSetFanModeRequest,
62+
ThermostatCoolRequest,
6263
ThermostatHeatRequest,
6364
} from "../types/route-requests"
6465
import {
@@ -624,6 +625,12 @@ export abstract class Routes {
624625
method: "POST",
625626
data: params,
626627
}),
628+
cool: (params: ThermostatCoolRequest) =>
629+
this.createActionAttemptAndWait({
630+
url: "/thermostats/cool",
631+
method: "POST",
632+
data: params,
633+
}),
627634
heat: (params: ThermostatHeatRequest) =>
628635
this.createActionAttemptAndWait({
629636
url: "/thermostats/heat",

src/types/route-requests.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,13 @@ export type ThermostatSetFanModeRequest = {
310310
fan_mode_setting: FanModeSetting
311311
}
312312

313+
export type ThermostatCoolRequest = {
314+
device_id: string
315+
sync?: boolean
316+
cooling_set_point_celsius?: number
317+
cooling_set_point_fahrenheit?: number
318+
}
319+
313320
export type ThermostatHeatRequest = {
314321
device_id: string
315322
sync?: boolean

tests/routes.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,20 @@ test(
465465
},
466466
"{}"
467467
)
468+
test(
469+
testAPIMethod("thermostats.cool"),
470+
{
471+
args: (seed) => [
472+
{
473+
device_id: seed.devices.nest.id1,
474+
cooling_set_point_fahrenheit: 60,
475+
},
476+
],
477+
load_devices_from: ["nest"],
478+
modifiesState: true,
479+
},
480+
"{}"
481+
)
468482
test(
469483
testAPIMethod("thermostats.climateSettingSchedules.get"),
470484
{

0 commit comments

Comments
 (0)