From d165991bed91b639fb932114e8f21e24a7733c69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 06:10:21 +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.466.1 to 1.471.0 - [Release notes](https://github.com/seamapi/types/releases) - [Changelog](https://github.com/seamapi/types/blob/main/.releaserc.json) - [Commits](https://github.com/seamapi/types/compare/v1.466.1...v1.471.0) --- updated-dependencies: - dependency-name: "@seamapi/types" dependency-version: 1.471.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 1fbc5d8..3d6d6e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "devDependencies": { "@seamapi/fake-seam-connect": "1.83.2", "@seamapi/nextlove-sdk-generator": "^1.19.0", - "@seamapi/types": "1.466.1", + "@seamapi/types": "1.471.0", "del": "^7.1.0", "markdown-toc": "^1.2.0", "prettier": "^3.2.5" @@ -476,9 +476,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.466.1", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.466.1.tgz", - "integrity": "sha512-sRDleDijArxo3RMWdxyaYZub+bpCs2FlJBcWhcYNMS3hPdyvlRWkqSuB88uu9H0WqK6mnzzPLNv/AO2EV1RVCw==", + "version": "1.471.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.471.0.tgz", + "integrity": "sha512-6zdP7J8I5e420Xm32+ccq+yCCsOUm6usWVCKL+R7zU8v7+MuXapJON43CIQD3wFLoHciTe/Z0VrUWT8TY0diOw==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 15685b5..9bae3ca 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@seamapi/fake-seam-connect": "1.83.2", "@seamapi/nextlove-sdk-generator": "^1.19.0", - "@seamapi/types": "1.466.1", + "@seamapi/types": "1.471.0", "del": "^7.1.0", "markdown-toc": "^1.2.0", "prettier": "^3.2.5" From 34ec7add3f6c9cabee8775b9eb8209cb87b0b31c Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Fri, 25 Jul 2025 06:11:05 +0000 Subject: [PATCH 2/2] ci: Generate code --- lib/seam/routes/clients/index.rb | 1 + lib/seam/routes/clients/thermostats.rb | 12 +++++++ .../clients/thermostats_daily_programs.rb | 34 +++++++++++++++++++ lib/seam/routes/resources/device.rb | 2 +- lib/seam/routes/resources/device_provider.rb | 2 +- lib/seam/routes/resources/unmanaged_device.rb | 2 +- 6 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 lib/seam/routes/clients/thermostats_daily_programs.rb diff --git a/lib/seam/routes/clients/index.rb b/lib/seam/routes/clients/index.rb index a0bd025..8055371 100644 --- a/lib/seam/routes/clients/index.rb +++ b/lib/seam/routes/clients/index.rb @@ -32,6 +32,7 @@ require_relative "phones_simulate" require_relative "spaces" require_relative "thermostats" +require_relative "thermostats_daily_programs" require_relative "thermostats_schedules" require_relative "thermostats_simulate" require_relative "user_identities" diff --git a/lib/seam/routes/clients/thermostats.rb b/lib/seam/routes/clients/thermostats.rb index 61b9f9e..77978fc 100644 --- a/lib/seam/routes/clients/thermostats.rb +++ b/lib/seam/routes/clients/thermostats.rb @@ -10,6 +10,10 @@ def initialize(client:, defaults:) @defaults = defaults end + def daily_programs + @daily_programs ||= Seam::Clients::ThermostatsDailyPrograms.new(client: @client, defaults: @defaults) + end + def schedules @schedules ||= Seam::Clients::ThermostatsSchedules.new(client: @client, defaults: @defaults) end @@ -109,6 +113,14 @@ def update_climate_preset(climate_preset_key:, device_id:, climate_preset_mode: nil end + + def update_weekly_program(device_id:, friday_program_id: nil, monday_program_id: nil, saturday_program_id: nil, sunday_program_id: nil, thursday_program_id: nil, tuesday_program_id: nil, wednesday_program_id: nil, wait_for_action_attempt: nil) + res = @client.post("/thermostats/update_weekly_program", {device_id: device_id, friday_program_id: friday_program_id, monday_program_id: monday_program_id, saturday_program_id: saturday_program_id, sunday_program_id: sunday_program_id, thursday_program_id: thursday_program_id, tuesday_program_id: tuesday_program_id, wednesday_program_id: wednesday_program_id}.compact) + + wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt + + Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) + end end end end diff --git a/lib/seam/routes/clients/thermostats_daily_programs.rb b/lib/seam/routes/clients/thermostats_daily_programs.rb new file mode 100644 index 0000000..30b4e7c --- /dev/null +++ b/lib/seam/routes/clients/thermostats_daily_programs.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +require "seam/helpers/action_attempt" + +module Seam + module Clients + class ThermostatsDailyPrograms + def initialize(client:, defaults:) + @client = client + @defaults = defaults + end + + def create(device_id:, name:, periods:) + res = @client.post("/thermostats/daily_programs/create", {device_id: device_id, name: name, periods: periods}.compact) + + Seam::Resources::ThermostatDailyProgram.load_from_response(res.body["thermostat_daily_program"]) + end + + def delete(thermostat_daily_program_id:) + @client.post("/thermostats/daily_programs/delete", {thermostat_daily_program_id: thermostat_daily_program_id}.compact) + + nil + end + + def update(name:, periods:, thermostat_daily_program_id:, wait_for_action_attempt: nil) + res = @client.post("/thermostats/daily_programs/update", {name: name, periods: periods, thermostat_daily_program_id: thermostat_daily_program_id}.compact) + + wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt + + Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) + end + end + end +end diff --git a/lib/seam/routes/resources/device.rb b/lib/seam/routes/resources/device.rb index b977520..c04e3f2 100644 --- a/lib/seam/routes/resources/device.rb +++ b/lib/seam/routes/resources/device.rb @@ -3,7 +3,7 @@ module Seam module Resources class Device < BaseResource - attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :can_unlock_with_code, :capabilities_supported, :connected_account_id, :custom_metadata, :device_id, :device_type, :display_name, :is_managed, :location, :nickname, :properties, :workspace_id + attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_run_thermostat_programs, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :can_unlock_with_code, :capabilities_supported, :connected_account_id, :custom_metadata, :device_id, :device_type, :display_name, :is_managed, :location, :nickname, :properties, :workspace_id date_accessor :created_at diff --git a/lib/seam/routes/resources/device_provider.rb b/lib/seam/routes/resources/device_provider.rb index 3f5458a..606ea88 100644 --- a/lib/seam/routes/resources/device_provider.rb +++ b/lib/seam/routes/resources/device_provider.rb @@ -3,7 +3,7 @@ module Seam module Resources class DeviceProvider < BaseResource - attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :can_unlock_with_code, :device_provider_name, :display_name, :image_url, :provider_categories + attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_run_thermostat_programs, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :can_unlock_with_code, :device_provider_name, :display_name, :image_url, :provider_categories end end end diff --git a/lib/seam/routes/resources/unmanaged_device.rb b/lib/seam/routes/resources/unmanaged_device.rb index 3b8ac3a..afa618b 100644 --- a/lib/seam/routes/resources/unmanaged_device.rb +++ b/lib/seam/routes/resources/unmanaged_device.rb @@ -3,7 +3,7 @@ module Seam module Resources class UnmanagedDevice < BaseResource - attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :can_unlock_with_code, :capabilities_supported, :connected_account_id, :device_id, :device_type, :is_managed, :location, :properties, :workspace_id + attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_run_thermostat_programs, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :can_unlock_with_code, :capabilities_supported, :connected_account_id, :device_id, :device_type, :is_managed, :location, :properties, :workspace_id date_accessor :created_at