From 1965c8c214d4cb497162ff4e836b77989d462d48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Sep 2026 03:43:44 +0000 Subject: [PATCH 1/2] feat(deps-dev): bump @seamapi/types in the seam group Bumps the seam group with 1 update: [@seamapi/types](https://github.com/seamapi/types). Updates `@seamapi/types` from 1.1081.0 to 1.1082.0 - [Release notes](https://github.com/seamapi/types/releases) - [Commits](https://github.com/seamapi/types/compare/v1.1081.0...v1.1082.0) --- updated-dependencies: - dependency-name: "@seamapi/types" dependency-version: 1.1082.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: seam ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7986f538..af8e8516 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@seamapi/blueprint": "^1.12.0", "@seamapi/fake-seam-connect": "2.0.6", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1081.0", + "@seamapi/types": "1.1082.0", "change-case": "^5.4.4", "execa": "^10.0.1", "prettier": "^3.9.6" @@ -882,9 +882,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1081.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1081.0.tgz", - "integrity": "sha512-bFh94NyhpR1nukmihSxLR68TAgYGvbk+JeBnOWHtmNkP9FABSeuplw6cXBjB7S+xiVoazUCnclgrJ9lVnijCvw==", + "version": "1.1082.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1082.0.tgz", + "integrity": "sha512-QDuaHzjq+i/6yQ+fGs2jUmuZ8QomanqnLAuP2NULyGmfpTTeI/pEGkUp9YmRjUrbFoM8LHNT3ZmsFi8/2JJYmA==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index c376d3cd..28bcc49c 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@seamapi/blueprint": "^1.12.0", "@seamapi/fake-seam-connect": "2.0.6", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1081.0", + "@seamapi/types": "1.1082.0", "change-case": "^5.4.4", "execa": "^10.0.1", "prettier": "^3.9.6" From 76430306997e8565c87fca7d859fdc0df2989238 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Tue, 29 Sep 2026 03:44:08 +0000 Subject: [PATCH 2/2] ci: Generate code --- src/Resources/ActionAttempt.php | 257 ++++++++++++++++++++++++++++++ src/Resources/Device.php | 6 + src/Resources/DeviceProvider.php | 6 + src/Resources/UnmanagedDevice.php | 6 + src/Routes/ThermostatsClient.php | 37 +++++ 5 files changed, 312 insertions(+) diff --git a/src/Resources/ActionAttempt.php b/src/Resources/ActionAttempt.php index 540d7f0c..b4930662 100644 --- a/src/Resources/ActionAttempt.php +++ b/src/Resources/ActionAttempt.php @@ -56,6 +56,10 @@ public static function from_json(mixed $json): ActionAttempt|null => \Seam\Resources\ActionAttempt\ActivateClimatePreset::from_json( $json, ), + \Seam\Resources\ActionAttempt\ActionType::ACTIVATE_WEEKLY_PROGRAM + => \Seam\Resources\ActionAttempt\ActivateWeeklyProgram::from_json( + $json, + ), \Seam\Resources\ActionAttempt\ActionType::SIMULATE_KEYPAD_CODE_ENTRY => \Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry::from_json( $json, @@ -721,6 +725,66 @@ public function __construct( } } + /** + * Activating the weekly program is pending. Known status values use subclasses; unknown values use this base class and retain their raw discriminator. + */ + class ActivateWeeklyProgram extends \Seam\Resources\ActionAttempt + { + public static function from_json( + mixed $json, + ): ActivateWeeklyProgram|null { + if (!$json) { + return null; + } + $discriminant = is_string($json->status ?? null) + ? \Seam\Resources\ActionAttempt\Status::tryFrom($json->status) + : null; + + return match ($discriminant) { + \Seam\Resources\ActionAttempt\Status::SUCCESS + => \Seam\Resources\ActionAttempt\ActivateWeeklyProgram\Success::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\Status::PENDING + => \Seam\Resources\ActionAttempt\ActivateWeeklyProgram\Pending::from_json( + $json, + ), + \Seam\Resources\ActionAttempt\Status::ERROR + => \Seam\Resources\ActionAttempt\ActivateWeeklyProgram\Error::from_json( + $json, + ), + default => new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + status: $json->status ?? null, + ), + }; + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + /** * Simulating a keypad code entry is pending. Known status values use subclasses; unknown values use this base class and retain their raw discriminator. */ @@ -1385,6 +1449,7 @@ enum ActionType: string case SET_FAN_MODE = "SET_FAN_MODE"; case SET_HVAC_MODE = "SET_HVAC_MODE"; case ACTIVATE_CLIMATE_PRESET = "ACTIVATE_CLIMATE_PRESET"; + case ACTIVATE_WEEKLY_PROGRAM = "ACTIVATE_WEEKLY_PROGRAM"; case SIMULATE_KEYPAD_CODE_ENTRY = "SIMULATE_KEYPAD_CODE_ENTRY"; case SIMULATE_MANUAL_LOCK_VIA_KEYPAD = "SIMULATE_MANUAL_LOCK_VIA_KEYPAD"; case PUSH_THERMOSTAT_PROGRAMS = "PUSH_THERMOSTAT_PROGRAMS"; @@ -5393,6 +5458,198 @@ public function __construct( } } +namespace Seam\Resources\ActionAttempt\ActivateWeeklyProgram { + /** + * Activating the weekly program is pending. + */ + final class Success extends + \Seam\Resources\ActionAttempt\ActivateWeeklyProgram + { + public static function from_json(mixed $json): Success|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: $json->result ?? null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public null $error, + /** + * Result of the action. + */ + public mixed $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Activating the weekly program is pending. + */ + final class Pending extends + \Seam\Resources\ActionAttempt\ActivateWeeklyProgram + { + public static function from_json(mixed $json): Pending|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public null $error, + /** + * Result of the action. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } + + /** + * Activating the weekly program is pending. + */ + final class Error extends + \Seam\Resources\ActionAttempt\ActivateWeeklyProgram + { + public static function from_json(mixed $json): Error|null + { + if (!$json) { + return null; + } + return new self( + action_attempt_id: $json->action_attempt_id ?? null, + action_type: $json->action_type ?? null, + error: isset($json->error) + ? \Seam\Resources\ActionAttempt\ActivateWeeklyProgram\Error\Error::from_json( + $json->error, + ) + : null, + result: null, + status: $json->status ?? null, + ); + } + + public function __construct( + /** + * ID of the action attempt. + */ + string|null $action_attempt_id, + /** + * Action attempt to track the status of locking a door. + * + * @var value-of<\Seam\Resources\ActionAttempt\ActionType>|string|null + */ + string|null $action_type, + /** + * Error associated with the action. + */ + public \Seam\Resources\ActionAttempt\ActivateWeeklyProgram\Error\Error|null $error, + /** + * Result of the action. + */ + public null $result, + /** + * @var value-of<\Seam\Resources\ActionAttempt\Status>|string|null + */ + string|null $status, + ) { + parent::__construct( + action_attempt_id: $action_attempt_id, + action_type: $action_type, + status: $status, + ); + } + } +} + +namespace Seam\Resources\ActionAttempt\ActivateWeeklyProgram\Error { + /** + * Error associated with the action. + */ + class Error + { + public static function from_json(mixed $json): Error|null + { + if (!$json) { + return null; + } + return new self( + message: $json->message ?? null, + type: $json->type ?? null, + ); + } + + public function __construct( + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + public string|null $message, + /** + * Type of the error. + */ + public string|null $type, + ) {} + } +} + namespace Seam\Resources\ActionAttempt\SimulateKeypadCodeEntry { /** * Simulating a keypad code entry is pending. diff --git a/src/Resources/Device.php b/src/Resources/Device.php index dbcaf323..5ace2754 100644 --- a/src/Resources/Device.php +++ b/src/Resources/Device.php @@ -35,6 +35,8 @@ public static function from_json(mixed $json): Device|null $json->warnings ?? [], ), workspace_id: $json->workspace_id ?? null, + can_activate_weekly_program: $json->can_activate_weekly_program ?? + null, can_configure_auto_lock: $json->can_configure_auto_lock ?? null, can_hvac_cool: $json->can_hvac_cool ?? null, can_hvac_heat: $json->can_hvac_heat ?? null, @@ -149,6 +151,10 @@ public function __construct( * Unique identifier for the Seam workspace associated with the device. */ public string|null $workspace_id, + /** + * Indicates whether the thermostat can be returned to its weekly program, the schedule that is configured on the device itself, releasing any hold that Seam has set. + */ + public bool|null $can_activate_weekly_program = null, /** * Indicates whether the lock supports configuring automatic locking. */ diff --git a/src/Resources/DeviceProvider.php b/src/Resources/DeviceProvider.php index 83cd35ca..7d92e33d 100644 --- a/src/Resources/DeviceProvider.php +++ b/src/Resources/DeviceProvider.php @@ -13,6 +13,8 @@ public static function from_json(mixed $json): DeviceProvider|null display_name: $json->display_name ?? null, image_url: $json->image_url ?? null, provider_categories: $json->provider_categories ?? null, + can_activate_weekly_program: $json->can_activate_weekly_program ?? + null, can_configure_auto_lock: $json->can_configure_auto_lock ?? null, can_hvac_cool: $json->can_hvac_cool ?? null, can_hvac_heat: $json->can_hvac_heat ?? null, @@ -67,6 +69,10 @@ public function __construct( * @var list|null */ public array|null $provider_categories, + /** + * Indicates whether the thermostat can be returned to its weekly program, the schedule that is configured on the device itself, releasing any hold that Seam has set. + */ + public bool|null $can_activate_weekly_program = null, /** * Indicates whether the lock supports configuring automatic locking. */ diff --git a/src/Resources/UnmanagedDevice.php b/src/Resources/UnmanagedDevice.php index b5a93f92..dd2ca044 100644 --- a/src/Resources/UnmanagedDevice.php +++ b/src/Resources/UnmanagedDevice.php @@ -40,6 +40,8 @@ public static function from_json(mixed $json): UnmanagedDevice|null $json->warnings ?? [], ), workspace_id: $json->workspace_id ?? null, + can_activate_weekly_program: $json->can_activate_weekly_program ?? + null, can_configure_auto_lock: $json->can_configure_auto_lock ?? null, can_hvac_cool: $json->can_hvac_cool ?? null, can_hvac_heat: $json->can_hvac_heat ?? null, @@ -137,6 +139,10 @@ public function __construct( * Unique identifier for the Seam workspace associated with the device. */ public string|null $workspace_id, + /** + * Indicates whether the thermostat can be returned to its weekly program, the schedule that is configured on the device itself, releasing any hold that Seam has set. + */ + public bool|null $can_activate_weekly_program = null, /** * Indicates whether the lock supports configuring automatic locking. */ diff --git a/src/Routes/ThermostatsClient.php b/src/Routes/ThermostatsClient.php index 24b10882..17d8a978 100644 --- a/src/Routes/ThermostatsClient.php +++ b/src/Routes/ThermostatsClient.php @@ -75,6 +75,43 @@ public function activate_climate_preset( ); } + /** + * Returns a specified [thermostat](https://www.seam.co/docs/capability-guides/thermostats) to its [weekly program](https://www.seam.co/docs/capability-guides/thermostats/creating-and-managing-thermostat-programs), the schedule that is configured on the device itself, releasing any hold that Seam has set. Seam stops managing the thermostat's climate until you [activate a climate preset](https://www.seam.co/docs/capability-guides/thermostats/configure-current-climate-settings), make a direct climate setting change, or one of the thermostat's [scheduled](https://www.seam.co/docs/capability-guides/thermostats/creating-and-managing-thermostat-schedules) presets reaches its activation time. + * + * @param string $device_id ID of the thermostat device that you want to return to its weekly program. + * @param bool|array|null $wait_for_action_attempt Whether to wait for the action attempt to finish, optionally with timeout and polling_interval in seconds. Defaults to the value set on the client. + * @return ActionAttempt OK + */ + public function activate_weekly_program( + string $device_id, + bool|array|null $wait_for_action_attempt = null, + ): ActionAttempt { + $request_payload = []; + + $request_payload["device_id"] = $device_id; + + $res = Body::decode( + $this->client->request( + "POST", + "/thermostats/activate_weekly_program", + ["json" => (object) $request_payload], + ), + ); + + return ResolveActionAttempt::resolve_action_attempt( + ActionAttempt::from_json( + Body::read( + $res, + "action_attempt", + "/thermostats/activate_weekly_program", + ), + ), + $this->client, + $wait_for_action_attempt ?? + $this->defaults["wait_for_action_attempt"], + ); + } + /** * Sets a specified [thermostat](https://www.seam.co/docs/capability-guides/thermostats) to [cool mode](https://www.seam.co/docs/capability-guides/thermostats/configure-current-climate-settings). *