seam 2.131.0 → 2.133.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/seam/http_multi_workspace.rb +2 -2
- data/lib/seam/http_single_workspace.rb +2 -2
- data/lib/seam/resources/access_code.rb +67 -0
- data/lib/seam/resources/access_grant.rb +51 -0
- data/lib/seam/resources/access_method.rb +46 -0
- data/lib/seam/resources/acs_access_group.rb +45 -0
- data/lib/seam/resources/acs_credential.rb +73 -0
- data/lib/seam/resources/acs_encoder.rb +37 -0
- data/lib/seam/resources/acs_entrance.rb +61 -0
- data/lib/seam/resources/acs_system.rb +54 -0
- data/lib/seam/resources/acs_user.rb +63 -0
- data/lib/seam/resources/action_attempt.rb +18 -0
- data/lib/seam/resources/batch.rb +134 -0
- data/lib/seam/resources/client_session.rb +44 -0
- data/lib/seam/resources/connect_webview.rb +59 -0
- data/lib/seam/resources/connected_account.rb +46 -0
- data/lib/seam/resources/customer_portal.rb +25 -0
- data/lib/seam/resources/device.rb +83 -0
- data/lib/seam/resources/device_provider.rb +56 -0
- data/lib/seam/resources/event.rb +193 -0
- data/lib/seam/{routes/resources → resources}/index.rb +3 -0
- data/lib/seam/resources/instant_key.rb +31 -0
- data/lib/seam/resources/noise_threshold.rb +23 -0
- data/lib/seam/resources/pagination.rb +15 -0
- data/lib/seam/resources/phone.rb +29 -0
- data/lib/seam/resources/space.rb +32 -0
- data/lib/seam/resources/thermostat_daily_program.rb +22 -0
- data/lib/seam/resources/thermostat_schedule.rb +34 -0
- data/lib/seam/resources/unmanaged_access_code.rb +53 -0
- data/lib/seam/resources/unmanaged_access_grant.rb +43 -0
- data/lib/seam/resources/unmanaged_access_method.rb +40 -0
- data/lib/seam/resources/unmanaged_device.rb +73 -0
- data/lib/seam/resources/unmanaged_user_identity.rb +29 -0
- data/lib/seam/resources/user_identity.rb +31 -0
- data/lib/seam/resources/webhook.rb +17 -0
- data/lib/seam/resources/workspace.rb +28 -0
- data/lib/seam/routes/access_codes.rb +227 -0
- data/lib/seam/routes/access_codes_simulate.rb +23 -0
- data/lib/seam/routes/access_codes_unmanaged.rb +76 -0
- data/lib/seam/routes/access_grants.rb +117 -0
- data/lib/seam/routes/access_grants_unmanaged.rb +50 -0
- data/lib/seam/routes/access_methods.rb +101 -0
- data/lib/seam/routes/access_methods_unmanaged.rb +33 -0
- data/lib/seam/routes/acs_access_groups.rb +82 -0
- data/lib/seam/routes/acs_credentials.rb +109 -0
- data/lib/seam/routes/{clients/acs_encoders.rb → acs_encoders.rb} +25 -0
- data/lib/seam/routes/acs_encoders_simulate.rb +55 -0
- data/lib/seam/routes/acs_entrances.rb +76 -0
- data/lib/seam/routes/acs_systems.rb +56 -0
- data/lib/seam/routes/acs_users.rb +150 -0
- data/lib/seam/routes/{clients/action_attempts.rb → action_attempts.rb} +9 -0
- data/lib/seam/routes/client_sessions.rb +102 -0
- data/lib/seam/routes/connect_webviews.rb +72 -0
- data/lib/seam/routes/connected_accounts.rb +77 -0
- data/lib/seam/routes/{clients/connected_accounts_simulate.rb → connected_accounts_simulate.rb} +3 -0
- data/lib/seam/routes/customers.rb +87 -0
- data/lib/seam/routes/devices.rb +95 -0
- data/lib/seam/routes/devices_simulate.rb +76 -0
- data/lib/seam/routes/devices_unmanaged.rb +66 -0
- data/lib/seam/routes/events.rb +59 -0
- data/lib/seam/routes/{clients/instant_keys.rb → instant_keys.rb} +10 -0
- data/lib/seam/routes/locks.rb +89 -0
- data/lib/seam/routes/{clients/locks_simulate.rb → locks_simulate.rb} +7 -0
- data/lib/seam/routes/noise_sensors.rb +45 -0
- data/lib/seam/routes/noise_sensors_noise_thresholds.rb +69 -0
- data/lib/seam/routes/noise_sensors_simulate.rb +21 -0
- data/lib/seam/routes/phones.rb +44 -0
- data/lib/seam/routes/phones_simulate.rb +24 -0
- data/lib/seam/routes/spaces.rb +145 -0
- data/lib/seam/routes/thermostats.rb +238 -0
- data/lib/seam/routes/{clients/thermostats_daily_programs.rb → thermostats_daily_programs.rb} +13 -0
- data/lib/seam/routes/thermostats_schedules.rb +70 -0
- data/lib/seam/routes/thermostats_simulate.rb +37 -0
- data/lib/seam/routes/user_identities.rb +167 -0
- data/lib/seam/routes/user_identities_unmanaged.rb +46 -0
- data/lib/seam/routes/{clients/webhooks.rb → webhooks.rb} +16 -0
- data/lib/seam/routes/workspaces.rb +77 -0
- data/lib/seam/version.rb +1 -1
- data/lib/seam/webhook.rb +1 -1
- metadata +83 -80
- data/lib/seam/routes/clients/access_codes.rb +0 -80
- data/lib/seam/routes/clients/access_codes_simulate.rb +0 -18
- data/lib/seam/routes/clients/access_codes_unmanaged.rb +0 -42
- data/lib/seam/routes/clients/access_grants.rb +0 -58
- data/lib/seam/routes/clients/access_grants_unmanaged.rb +0 -30
- data/lib/seam/routes/clients/access_methods.rb +0 -66
- data/lib/seam/routes/clients/access_methods_unmanaged.rb +0 -24
- data/lib/seam/routes/clients/acs_access_groups.rb +0 -54
- data/lib/seam/routes/clients/acs_credentials.rb +0 -60
- data/lib/seam/routes/clients/acs_encoders_simulate.rb +0 -36
- data/lib/seam/routes/clients/acs_entrances.rb +0 -46
- data/lib/seam/routes/clients/acs_systems.rb +0 -36
- data/lib/seam/routes/clients/acs_users.rb +0 -78
- data/lib/seam/routes/clients/client_sessions.rb +0 -54
- data/lib/seam/routes/clients/connect_webviews.rb +0 -36
- data/lib/seam/routes/clients/connected_accounts.rb +0 -46
- data/lib/seam/routes/clients/customers.rb +0 -30
- data/lib/seam/routes/clients/devices.rb +0 -50
- data/lib/seam/routes/clients/devices_simulate.rb +0 -48
- data/lib/seam/routes/clients/devices_unmanaged.rb +0 -30
- data/lib/seam/routes/clients/events.rb +0 -24
- data/lib/seam/routes/clients/locks.rb +0 -54
- data/lib/seam/routes/clients/noise_sensors.rb +0 -26
- data/lib/seam/routes/clients/noise_sensors_noise_thresholds.rb +0 -42
- data/lib/seam/routes/clients/noise_sensors_simulate.rb +0 -18
- data/lib/seam/routes/clients/phones.rb +0 -34
- data/lib/seam/routes/clients/phones_simulate.rb +0 -18
- data/lib/seam/routes/clients/spaces.rb +0 -84
- data/lib/seam/routes/clients/thermostats.rb +0 -126
- data/lib/seam/routes/clients/thermostats_schedules.rb +0 -42
- data/lib/seam/routes/clients/thermostats_simulate.rb +0 -24
- data/lib/seam/routes/clients/user_identities.rb +0 -100
- data/lib/seam/routes/clients/user_identities_unmanaged.rb +0 -30
- data/lib/seam/routes/clients/workspaces.rb +0 -46
- data/lib/seam/routes/resources/access_code.rb +0 -14
- data/lib/seam/routes/resources/access_grant.rb +0 -14
- data/lib/seam/routes/resources/access_method.rb +0 -14
- data/lib/seam/routes/resources/acs_access_group.rb +0 -14
- data/lib/seam/routes/resources/acs_credential.rb +0 -14
- data/lib/seam/routes/resources/acs_encoder.rb +0 -13
- data/lib/seam/routes/resources/acs_entrance.rb +0 -14
- data/lib/seam/routes/resources/acs_system.rb +0 -14
- data/lib/seam/routes/resources/acs_user.rb +0 -14
- data/lib/seam/routes/resources/action_attempt.rb +0 -9
- data/lib/seam/routes/resources/batch.rb +0 -9
- data/lib/seam/routes/resources/client_session.rb +0 -11
- data/lib/seam/routes/resources/connect_webview.rb +0 -11
- data/lib/seam/routes/resources/connected_account.rb +0 -14
- data/lib/seam/routes/resources/customer_portal.rb +0 -11
- data/lib/seam/routes/resources/device.rb +0 -14
- data/lib/seam/routes/resources/device_provider.rb +0 -9
- data/lib/seam/routes/resources/event.rb +0 -11
- data/lib/seam/routes/resources/instant_key.rb +0 -11
- data/lib/seam/routes/resources/noise_threshold.rb +0 -9
- data/lib/seam/routes/resources/pagination.rb +0 -9
- data/lib/seam/routes/resources/phone.rb +0 -14
- data/lib/seam/routes/resources/space.rb +0 -11
- data/lib/seam/routes/resources/thermostat_daily_program.rb +0 -11
- data/lib/seam/routes/resources/thermostat_schedule.rb +0 -13
- data/lib/seam/routes/resources/unmanaged_access_code.rb +0 -14
- data/lib/seam/routes/resources/unmanaged_device.rb +0 -14
- data/lib/seam/routes/resources/user_identity.rb +0 -14
- data/lib/seam/routes/resources/webhook.rb +0 -9
- data/lib/seam/routes/resources/workspace.rb +0 -9
- /data/lib/seam/{routes/resources → resources}/resource_error.rb +0 -0
- /data/lib/seam/{routes/resources → resources}/resource_errors_support.rb +0 -0
- /data/lib/seam/{routes/resources → resources}/resource_warning.rb +0 -0
- /data/lib/seam/{routes/resources → resources}/resource_warnings_support.rb +0 -0
- /data/lib/seam/routes/{clients/acs.rb → acs.rb} +0 -0
- /data/lib/seam/routes/{clients/index.rb → index.rb} +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Seam
|
|
4
|
+
module Clients
|
|
5
|
+
class PhonesSimulate
|
|
6
|
+
def initialize(client:, defaults:)
|
|
7
|
+
@client = client
|
|
8
|
+
@defaults = defaults
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Creates a new simulated phone in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Creating a Simulated Phone for a User Identity](https://docs.seam.co/capability-guides/mobile-access/developing-in-a-sandbox-workspace#creating-a-simulated-phone-for-a-user-identity).
|
|
12
|
+
# @param user_identity_id ID of the user identity that you want to associate with the simulated phone.
|
|
13
|
+
# @param assa_abloy_metadata ASSA ABLOY metadata that you want to associate with the simulated phone.
|
|
14
|
+
# @param custom_sdk_installation_id ID of the custom SDK installation that you want to use for the simulated phone.
|
|
15
|
+
# @param phone_metadata Metadata that you want to associate with the simulated phone.
|
|
16
|
+
# @return [Seam::Resources::Phone] OK
|
|
17
|
+
def create_sandbox_phone(user_identity_id:, assa_abloy_metadata: nil, custom_sdk_installation_id: nil, phone_metadata: nil)
|
|
18
|
+
res = @client.post("/phones/simulate/create_sandbox_phone", {user_identity_id: user_identity_id, assa_abloy_metadata: assa_abloy_metadata, custom_sdk_installation_id: custom_sdk_installation_id, phone_metadata: phone_metadata}.compact)
|
|
19
|
+
|
|
20
|
+
Seam::Resources::Phone.load_from_response(res.body["phone"])
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Seam
|
|
4
|
+
module Clients
|
|
5
|
+
class Spaces
|
|
6
|
+
def initialize(client:, defaults:)
|
|
7
|
+
@client = client
|
|
8
|
+
@defaults = defaults
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Adds [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) to a specific space.
|
|
12
|
+
# @param acs_entrance_ids IDs of the entrances that you want to add to the space.
|
|
13
|
+
# @param space_id ID of the space to which you want to add entrances.
|
|
14
|
+
# @return [nil] OK
|
|
15
|
+
def add_acs_entrances(acs_entrance_ids:, space_id:)
|
|
16
|
+
@client.post("/spaces/add_acs_entrances", {acs_entrance_ids: acs_entrance_ids, space_id: space_id}.compact)
|
|
17
|
+
|
|
18
|
+
nil
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Adds a [connected account](https://docs.seam.co/core-concepts/connected-accounts) to a specific space.
|
|
22
|
+
# @param connected_account_id ID of the connected account that you want to add to the space.
|
|
23
|
+
# @param space_id ID of the space to which you want to add the connected account.
|
|
24
|
+
# @return [nil] OK
|
|
25
|
+
def add_connected_account(connected_account_id:, space_id:)
|
|
26
|
+
@client.post("/spaces/add_connected_account", {connected_account_id: connected_account_id, space_id: space_id}.compact)
|
|
27
|
+
|
|
28
|
+
nil
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Adds devices to a specific space.
|
|
32
|
+
# @param device_ids IDs of the devices that you want to add to the space.
|
|
33
|
+
# @param space_id ID of the space to which you want to add devices.
|
|
34
|
+
# @return [nil] OK
|
|
35
|
+
def add_devices(device_ids:, space_id:)
|
|
36
|
+
@client.post("/spaces/add_devices", {device_ids: device_ids, space_id: space_id}.compact)
|
|
37
|
+
|
|
38
|
+
nil
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Creates a new space.
|
|
42
|
+
# @param name Name of the space that you want to create.
|
|
43
|
+
# @param acs_entrance_ids IDs of the entrances that you want to add to the new space.
|
|
44
|
+
# @param connected_account_ids IDs of connected accounts to associate with the new space. Persisted on seam.location_third_party_account so the UI can show which provider account(s) a space came from.
|
|
45
|
+
# @param customer_data Reservation/stay-related defaults for the space.
|
|
46
|
+
# @param customer_key Customer key for which you want to create the space.
|
|
47
|
+
# @param device_ids IDs of the devices that you want to add to the new space.
|
|
48
|
+
# @param space_key Unique key for the space within the workspace.
|
|
49
|
+
# @return [Seam::Resources::Space] OK
|
|
50
|
+
def create(name:, acs_entrance_ids: nil, connected_account_ids: nil, customer_data: nil, customer_key: nil, device_ids: nil, space_key: nil)
|
|
51
|
+
res = @client.post("/spaces/create", {name: name, acs_entrance_ids: acs_entrance_ids, connected_account_ids: connected_account_ids, customer_data: customer_data, customer_key: customer_key, device_ids: device_ids, space_key: space_key}.compact)
|
|
52
|
+
|
|
53
|
+
Seam::Resources::Space.load_from_response(res.body["space"])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Deletes a space.
|
|
57
|
+
# @param space_id ID of the space that you want to delete.
|
|
58
|
+
# @return [nil] OK
|
|
59
|
+
def delete(space_id:)
|
|
60
|
+
@client.post("/spaces/delete", {space_id: space_id}.compact)
|
|
61
|
+
|
|
62
|
+
nil
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Gets a space.
|
|
66
|
+
# @param space_id ID of the space that you want to get.
|
|
67
|
+
# @param space_key Unique key of the space that you want to get.
|
|
68
|
+
# @return [Seam::Resources::Space] OK
|
|
69
|
+
def get(space_id: nil, space_key: nil)
|
|
70
|
+
res = @client.post("/spaces/get", {space_id: space_id, space_key: space_key}.compact)
|
|
71
|
+
|
|
72
|
+
Seam::Resources::Space.load_from_response(res.body["space"])
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Gets all related resources for one or more Spaces.
|
|
76
|
+
# @param exclude
|
|
77
|
+
# @param include
|
|
78
|
+
# @param space_ids IDs of the spaces that you want to get along with their related resources.
|
|
79
|
+
# @param space_keys Keys of the spaces that you want to get along with their related resources.
|
|
80
|
+
# @return [Seam::Resources::Batch] OK
|
|
81
|
+
def get_related(exclude: nil, include: nil, space_ids: nil, space_keys: nil)
|
|
82
|
+
res = @client.post("/spaces/get_related", {exclude: exclude, include: include, space_ids: space_ids, space_keys: space_keys}.compact)
|
|
83
|
+
|
|
84
|
+
Seam::Resources::Batch.load_from_response(res.body["batch"])
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Returns a list of all spaces.
|
|
88
|
+
# @param customer_key Customer key for which you want to list spaces.
|
|
89
|
+
# @param limit Maximum number of records to return per page.
|
|
90
|
+
# @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
|
|
91
|
+
# @param search String for which to search. Filters returned spaces to include all records that satisfy a partial match using `name`, `space_key`, or `customer_key`.
|
|
92
|
+
# @param space_key Filter spaces by space_key.
|
|
93
|
+
# @return [Seam::Resources::Space] OK
|
|
94
|
+
def list(customer_key: nil, limit: nil, page_cursor: nil, search: nil, space_key: nil)
|
|
95
|
+
res = @client.post("/spaces/list", {customer_key: customer_key, limit: limit, page_cursor: page_cursor, search: search, space_key: space_key}.compact)
|
|
96
|
+
|
|
97
|
+
Seam::Resources::Space.load_from_response(res.body["spaces"])
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Removes [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) from a specific space.
|
|
101
|
+
# @param acs_entrance_ids IDs of the entrances that you want to remove from the space.
|
|
102
|
+
# @param space_id ID of the space from which you want to remove entrances.
|
|
103
|
+
# @return [nil] OK
|
|
104
|
+
def remove_acs_entrances(acs_entrance_ids:, space_id:)
|
|
105
|
+
@client.post("/spaces/remove_acs_entrances", {acs_entrance_ids: acs_entrance_ids, space_id: space_id}.compact)
|
|
106
|
+
|
|
107
|
+
nil
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Removes a [connected account](https://docs.seam.co/core-concepts/connected-accounts) from a specific space.
|
|
111
|
+
# @param connected_account_id ID of the connected account that you want to remove from the space.
|
|
112
|
+
# @param space_id ID of the space from which you want to remove the connected account.
|
|
113
|
+
# @return [nil] OK
|
|
114
|
+
def remove_connected_account(connected_account_id:, space_id:)
|
|
115
|
+
@client.post("/spaces/remove_connected_account", {connected_account_id: connected_account_id, space_id: space_id}.compact)
|
|
116
|
+
|
|
117
|
+
nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Removes devices from a specific space.
|
|
121
|
+
# @param device_ids IDs of the devices that you want to remove from the space.
|
|
122
|
+
# @param space_id ID of the space from which you want to remove devices.
|
|
123
|
+
# @return [nil] OK
|
|
124
|
+
def remove_devices(device_ids:, space_id:)
|
|
125
|
+
@client.post("/spaces/remove_devices", {device_ids: device_ids, space_id: space_id}.compact)
|
|
126
|
+
|
|
127
|
+
nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Updates an existing space.
|
|
131
|
+
# @param acs_entrance_ids IDs of the entrances that you want to set for the space. If specified, this will replace all existing entrances.
|
|
132
|
+
# @param customer_data Reservation/stay-related defaults for the space. Only the keys you provide are updated; omit a key to leave it unchanged. Pass null on a key to clear it.
|
|
133
|
+
# @param device_ids IDs of the devices that you want to set for the space. If specified, this will replace all existing devices.
|
|
134
|
+
# @param name Name of the space.
|
|
135
|
+
# @param space_id ID of the space that you want to update.
|
|
136
|
+
# @param space_key Unique key of the space that you want to update.
|
|
137
|
+
# @return [Seam::Resources::Space] OK
|
|
138
|
+
def update(acs_entrance_ids: nil, customer_data: nil, device_ids: nil, name: nil, space_id: nil, space_key: nil)
|
|
139
|
+
res = @client.post("/spaces/update", {acs_entrance_ids: acs_entrance_ids, customer_data: customer_data, device_ids: device_ids, name: name, space_id: space_id, space_key: space_key}.compact)
|
|
140
|
+
|
|
141
|
+
Seam::Resources::Space.load_from_response(res.body["space"])
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "seam/helpers/action_attempt"
|
|
4
|
+
|
|
5
|
+
module Seam
|
|
6
|
+
module Clients
|
|
7
|
+
class Thermostats
|
|
8
|
+
def initialize(client:, defaults:)
|
|
9
|
+
@client = client
|
|
10
|
+
@defaults = defaults
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def daily_programs
|
|
14
|
+
@daily_programs ||= Seam::Clients::ThermostatsDailyPrograms.new(client: @client, defaults: @defaults)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def schedules
|
|
18
|
+
@schedules ||= Seam::Clients::ThermostatsSchedules.new(client: @client, defaults: @defaults)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def simulate
|
|
22
|
+
@simulate ||= Seam::Clients::ThermostatsSimulate.new(client: @client, defaults: @defaults)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Activates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats).
|
|
26
|
+
# @param climate_preset_key Climate preset key of the climate preset that you want to activate.
|
|
27
|
+
# @param device_id ID of the thermostat device for which you want to activate a climate preset.
|
|
28
|
+
# @return [Seam::Resources::ActionAttempt] OK
|
|
29
|
+
def activate_climate_preset(climate_preset_key:, device_id:, wait_for_action_attempt: nil)
|
|
30
|
+
res = @client.post("/thermostats/activate_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id}.compact)
|
|
31
|
+
|
|
32
|
+
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
|
33
|
+
|
|
34
|
+
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [cool mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings).
|
|
38
|
+
# @param device_id ID of the thermostat device that you want to set to cool mode.
|
|
39
|
+
# @param cooling_set_point_celsius [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters.
|
|
40
|
+
# @param cooling_set_point_fahrenheit [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters.
|
|
41
|
+
# @return [Seam::Resources::ActionAttempt] OK
|
|
42
|
+
def cool(device_id:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, wait_for_action_attempt: nil)
|
|
43
|
+
res = @client.post("/thermostats/cool", {device_id: device_id, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit}.compact)
|
|
44
|
+
|
|
45
|
+
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
|
46
|
+
|
|
47
|
+
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Creates a [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats).
|
|
51
|
+
# @param climate_preset_key Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets).
|
|
52
|
+
# @param device_id ID of the thermostat device for which you want create a climate preset.
|
|
53
|
+
# @param climate_preset_mode The climate preset mode for the thermostat, based on the available climate preset modes reported by the device.
|
|
54
|
+
# @param cooling_set_point_celsius Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points).
|
|
55
|
+
# @param cooling_set_point_fahrenheit Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points).
|
|
56
|
+
# @param ecobee_metadata Metadata specific to the Ecobee climate, if applicable.
|
|
57
|
+
# @param fan_mode_setting Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`.
|
|
58
|
+
# @param heating_set_point_celsius Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points).
|
|
59
|
+
# @param heating_set_point_fahrenheit Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points).
|
|
60
|
+
# @param hvac_mode_setting Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`.
|
|
61
|
+
# @param manual_override_allowed Indicates whether a person at the thermostat or using the API can change the thermostat's settings.
|
|
62
|
+
# @deprecated manual_override_allowed: Use 'thermostat_schedule.is_override_allowed'
|
|
63
|
+
# @param name User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets).
|
|
64
|
+
# @return [nil] OK
|
|
65
|
+
def create_climate_preset(climate_preset_key:, device_id:, climate_preset_mode: nil, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, ecobee_metadata: nil, fan_mode_setting: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, hvac_mode_setting: nil, manual_override_allowed: nil, name: nil)
|
|
66
|
+
@client.post("/thermostats/create_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id, climate_preset_mode: climate_preset_mode, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, ecobee_metadata: ecobee_metadata, fan_mode_setting: fan_mode_setting, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit, hvac_mode_setting: hvac_mode_setting, manual_override_allowed: manual_override_allowed, name: name}.compact)
|
|
67
|
+
|
|
68
|
+
nil
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Deletes a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats).
|
|
72
|
+
# @param climate_preset_key Climate preset key of the climate preset that you want to delete.
|
|
73
|
+
# @param device_id ID of the thermostat device for which you want to delete a climate preset.
|
|
74
|
+
# @return [nil] OK
|
|
75
|
+
def delete_climate_preset(climate_preset_key:, device_id:)
|
|
76
|
+
@client.post("/thermostats/delete_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id}.compact)
|
|
77
|
+
|
|
78
|
+
nil
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings).
|
|
82
|
+
# @param device_id ID of the thermostat device that you want to set to heat mode.
|
|
83
|
+
# @param heating_set_point_celsius [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `heating_set_point` parameters.
|
|
84
|
+
# @param heating_set_point_fahrenheit [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `heating_set_point` parameters.
|
|
85
|
+
# @return [Seam::Resources::ActionAttempt] OK
|
|
86
|
+
def heat(device_id:, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, wait_for_action_attempt: nil)
|
|
87
|
+
res = @client.post("/thermostats/heat", {device_id: device_id, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit}.compact)
|
|
88
|
+
|
|
89
|
+
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
|
90
|
+
|
|
91
|
+
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat-cool ("auto") mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings).
|
|
95
|
+
# @param device_id ID of the thermostat device that you want to set to heat-cool mode.
|
|
96
|
+
# @param cooling_set_point_celsius [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters.
|
|
97
|
+
# @param cooling_set_point_fahrenheit [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters.
|
|
98
|
+
# @param heating_set_point_celsius [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `heating_set_point` parameters.
|
|
99
|
+
# @param heating_set_point_fahrenheit [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `heating_set_point` parameters.
|
|
100
|
+
# @return [Seam::Resources::ActionAttempt] OK
|
|
101
|
+
def heat_cool(device_id:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, wait_for_action_attempt: nil)
|
|
102
|
+
res = @client.post("/thermostats/heat_cool", {device_id: device_id, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit}.compact)
|
|
103
|
+
|
|
104
|
+
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
|
105
|
+
|
|
106
|
+
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Returns a list of all [thermostats](https://docs.seam.co/capability-guides/thermostats).
|
|
110
|
+
# @param connect_webview_id ID of the Connect Webview for which you want to list devices.
|
|
111
|
+
# @param connected_account_id ID of the connected account for which you want to list devices.
|
|
112
|
+
# @param connected_account_ids Array of IDs of the connected accounts for which you want to list devices.
|
|
113
|
+
# @param created_before Timestamp by which to limit returned devices. Returns devices created before this timestamp.
|
|
114
|
+
# @param custom_metadata_has Set of key:value [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) pairs for which you want to list devices.
|
|
115
|
+
# @param customer_key Customer key for which you want to list devices.
|
|
116
|
+
# @param device_ids Array of device IDs for which you want to list devices.
|
|
117
|
+
# @param device_type Device type by which you want to filter thermostat devices.
|
|
118
|
+
# @param device_types Array of device types by which you want to filter thermostat devices.
|
|
119
|
+
# @param limit Numerical limit on the number of devices to return.
|
|
120
|
+
# @param manufacturer Manufacturer by which you want to filter thermostat devices.
|
|
121
|
+
# @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
|
|
122
|
+
# @param search String for which to search. Filters returned devices to include all records that satisfy a partial match using `device_id` (full or partial UUID prefix, minimum 4 characters), `connected_account_id`, `display_name`, `custom_metadata` or `location.location_name`.
|
|
123
|
+
# @param space_id ID of the space for which you want to list devices.
|
|
124
|
+
# @param unstable_location_id
|
|
125
|
+
# @deprecated unstable_location_id: Use `space_id`.
|
|
126
|
+
# @param user_identifier_key Your own internal user ID for the user for which you want to list devices.
|
|
127
|
+
# @return [Seam::Resources::Device] OK
|
|
128
|
+
def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil)
|
|
129
|
+
res = @client.post("/thermostats/list", {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, search: search, space_id: space_id, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact)
|
|
130
|
+
|
|
131
|
+
Seam::Resources::Device.load_from_response(res.body["devices"])
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to ["off" mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings).
|
|
135
|
+
# @param device_id ID of the thermostat device that you want to set to off mode.
|
|
136
|
+
# @return [Seam::Resources::ActionAttempt] OK
|
|
137
|
+
def off(device_id:, wait_for_action_attempt: nil)
|
|
138
|
+
res = @client.post("/thermostats/off", {device_id: device_id}.compact)
|
|
139
|
+
|
|
140
|
+
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
|
141
|
+
|
|
142
|
+
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Sets a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) as the ["fallback"](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets/setting-the-fallback-climate-preset) preset for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats).
|
|
146
|
+
# @param climate_preset_key Climate preset key of the climate preset that you want to set as the fallback climate preset.
|
|
147
|
+
# @param device_id ID of the thermostat device for which you want to set the fallback climate preset.
|
|
148
|
+
# @return [nil] OK
|
|
149
|
+
def set_fallback_climate_preset(climate_preset_key:, device_id:)
|
|
150
|
+
@client.post("/thermostats/set_fallback_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id}.compact)
|
|
151
|
+
|
|
152
|
+
nil
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Sets the [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats).
|
|
156
|
+
# @param device_id ID of the thermostat device for which you want to set the fan mode.
|
|
157
|
+
# @param fan_mode Fan mode setting for the thermostat, such as `auto`, `on`, or `circulate`.
|
|
158
|
+
# @deprecated fan_mode: Use `fan_mode_setting` instead.
|
|
159
|
+
# @param fan_mode_setting [Fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) that you want to set for the thermostat.
|
|
160
|
+
# @return [Seam::Resources::ActionAttempt] OK
|
|
161
|
+
def set_fan_mode(device_id:, fan_mode: nil, fan_mode_setting: nil, wait_for_action_attempt: nil)
|
|
162
|
+
res = @client.post("/thermostats/set_fan_mode", {device_id: device_id, fan_mode: fan_mode, fan_mode_setting: fan_mode_setting}.compact)
|
|
163
|
+
|
|
164
|
+
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
|
165
|
+
|
|
166
|
+
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Sets the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats).
|
|
170
|
+
# @param device_id ID of the thermostat device for which you want to set the HVAC mode.
|
|
171
|
+
# @param hvac_mode_setting
|
|
172
|
+
# @param cooling_set_point_celsius [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters.
|
|
173
|
+
# @param cooling_set_point_fahrenheit [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters.
|
|
174
|
+
# @param heating_set_point_celsius [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `heating_set_point` parameters.
|
|
175
|
+
# @param heating_set_point_fahrenheit [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `heating_set_point` parameters.
|
|
176
|
+
# @return [Seam::Resources::ActionAttempt] OK
|
|
177
|
+
def set_hvac_mode(device_id:, hvac_mode_setting:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, wait_for_action_attempt: nil)
|
|
178
|
+
res = @client.post("/thermostats/set_hvac_mode", {device_id: device_id, hvac_mode_setting: hvac_mode_setting, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit}.compact)
|
|
179
|
+
|
|
180
|
+
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
|
181
|
+
|
|
182
|
+
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Sets a [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) for a specified thermostat. Seam emits a `thermostat.temperature_threshold_exceeded` event and adds a warning on a thermostat if it reports a temperature outside the threshold range.
|
|
186
|
+
# @param device_id ID of the thermostat device for which you want to set a temperature threshold.
|
|
187
|
+
# @param lower_limit_celsius Lower temperature limit in in °C. Seam alerts you if the reported temperature is lower than this value. You can specify either `lower_limit` but not both.
|
|
188
|
+
# @param lower_limit_fahrenheit Lower temperature limit in in °F. Seam alerts you if the reported temperature is lower than this value. You can specify either `lower_limit` but not both.
|
|
189
|
+
# @param upper_limit_celsius Upper temperature limit in in °C. Seam alerts you if the reported temperature is higher than this value. You can specify either `upper_limit` but not both.
|
|
190
|
+
# @param upper_limit_fahrenheit Upper temperature limit in in °C. Seam alerts you if the reported temperature is higher than this value. You can specify either `upper_limit` but not both.
|
|
191
|
+
# @return [nil] OK
|
|
192
|
+
def set_temperature_threshold(device_id:, lower_limit_celsius: nil, lower_limit_fahrenheit: nil, upper_limit_celsius: nil, upper_limit_fahrenheit: nil)
|
|
193
|
+
@client.post("/thermostats/set_temperature_threshold", {device_id: device_id, lower_limit_celsius: lower_limit_celsius, lower_limit_fahrenheit: lower_limit_fahrenheit, upper_limit_celsius: upper_limit_celsius, upper_limit_fahrenheit: upper_limit_fahrenheit}.compact)
|
|
194
|
+
|
|
195
|
+
nil
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Updates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats).
|
|
199
|
+
# @param climate_preset_key Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets).
|
|
200
|
+
# @param device_id ID of the thermostat device for which you want to update a climate preset.
|
|
201
|
+
# @param climate_preset_mode The climate preset mode for the thermostat, based on the available climate preset modes reported by the device.
|
|
202
|
+
# @param cooling_set_point_celsius Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points).
|
|
203
|
+
# @param cooling_set_point_fahrenheit Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points).
|
|
204
|
+
# @param ecobee_metadata Metadata specific to the Ecobee climate, if applicable.
|
|
205
|
+
# @param fan_mode_setting Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`.
|
|
206
|
+
# @param heating_set_point_celsius Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points).
|
|
207
|
+
# @param heating_set_point_fahrenheit Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points).
|
|
208
|
+
# @param hvac_mode_setting Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`.
|
|
209
|
+
# @param manual_override_allowed Indicates whether a person at the thermostat can change the thermostat's settings. See [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions).
|
|
210
|
+
# @deprecated manual_override_allowed: Use 'thermostat_schedule.is_override_allowed'
|
|
211
|
+
# @param name User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets).
|
|
212
|
+
# @return [nil] OK
|
|
213
|
+
def update_climate_preset(climate_preset_key:, device_id:, climate_preset_mode: nil, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, ecobee_metadata: nil, fan_mode_setting: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, hvac_mode_setting: nil, manual_override_allowed: nil, name: nil)
|
|
214
|
+
@client.post("/thermostats/update_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id, climate_preset_mode: climate_preset_mode, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, ecobee_metadata: ecobee_metadata, fan_mode_setting: fan_mode_setting, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit, hvac_mode_setting: hvac_mode_setting, manual_override_allowed: manual_override_allowed, name: name}.compact)
|
|
215
|
+
|
|
216
|
+
nil
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Updates the thermostat weekly program for a thermostat device. To configure a weekly program, specify the ID of the daily program that you want to use for each day of the week. When you update a weekly program, the set of programs that you specify overwrites any previous weekly program for the thermostat.
|
|
220
|
+
# @param device_id ID of the thermostat device for which you want to update the weekly program.
|
|
221
|
+
# @param friday_program_id ID of the thermostat daily program to run on Fridays.
|
|
222
|
+
# @param monday_program_id ID of the thermostat daily program to run on Mondays.
|
|
223
|
+
# @param saturday_program_id ID of the thermostat daily program to run on Saturdays.
|
|
224
|
+
# @param sunday_program_id ID of the thermostat daily program to run on Sundays.
|
|
225
|
+
# @param thursday_program_id ID of the thermostat daily program to run on Thursdays.
|
|
226
|
+
# @param tuesday_program_id ID of the thermostat daily program to run on Tuesdays.
|
|
227
|
+
# @param wednesday_program_id ID of the thermostat daily program to run on Wednesdays.
|
|
228
|
+
# @return [Seam::Resources::ActionAttempt] OK
|
|
229
|
+
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)
|
|
230
|
+
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)
|
|
231
|
+
|
|
232
|
+
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
|
233
|
+
|
|
234
|
+
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
end
|
data/lib/seam/routes/{clients/thermostats_daily_programs.rb → thermostats_daily_programs.rb}
RENAMED
|
@@ -10,18 +10,31 @@ module Seam
|
|
|
10
10
|
@defaults = defaults
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
+
# Creates a new thermostat daily program. A daily program consists of a set of periods, where each period includes a start time and the key of a configured climate preset. Once you have defined a daily program, you can assign it to one or more days within a weekly program.
|
|
14
|
+
# @param device_id ID of the thermostat device for which you want to create a daily program.
|
|
15
|
+
# @param name Name of the thermostat daily program.
|
|
16
|
+
# @param periods Array of thermostat daily program periods.
|
|
17
|
+
# @return [Seam::Resources::ThermostatDailyProgram] OK
|
|
13
18
|
def create(device_id:, name:, periods:)
|
|
14
19
|
res = @client.post("/thermostats/daily_programs/create", {device_id: device_id, name: name, periods: periods}.compact)
|
|
15
20
|
|
|
16
21
|
Seam::Resources::ThermostatDailyProgram.load_from_response(res.body["thermostat_daily_program"])
|
|
17
22
|
end
|
|
18
23
|
|
|
24
|
+
# Deletes a thermostat daily program.
|
|
25
|
+
# @param thermostat_daily_program_id ID of the thermostat daily program that you want to delete.
|
|
26
|
+
# @return [nil] OK
|
|
19
27
|
def delete(thermostat_daily_program_id:)
|
|
20
28
|
@client.post("/thermostats/daily_programs/delete", {thermostat_daily_program_id: thermostat_daily_program_id}.compact)
|
|
21
29
|
|
|
22
30
|
nil
|
|
23
31
|
end
|
|
24
32
|
|
|
33
|
+
# Updates a specified thermostat daily program. The periods that you specify overwrite any existing periods for the daily program.
|
|
34
|
+
# @param name Name of the thermostat daily program that you want to update.
|
|
35
|
+
# @param periods Array of thermostat daily program periods. The periods that you specify overwrite any existing periods for the daily program.
|
|
36
|
+
# @param thermostat_daily_program_id ID of the thermostat daily program that you want to update.
|
|
37
|
+
# @return [Seam::Resources::ActionAttempt] OK
|
|
25
38
|
def update(name:, periods:, thermostat_daily_program_id:, wait_for_action_attempt: nil)
|
|
26
39
|
res = @client.post("/thermostats/daily_programs/update", {name: name, periods: periods, thermostat_daily_program_id: thermostat_daily_program_id}.compact)
|
|
27
40
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Seam
|
|
4
|
+
module Clients
|
|
5
|
+
class ThermostatsSchedules
|
|
6
|
+
def initialize(client:, defaults:)
|
|
7
|
+
@client = client
|
|
8
|
+
@defaults = defaults
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Creates a new [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats).
|
|
12
|
+
# @param climate_preset_key Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the new thermostat schedule.
|
|
13
|
+
# @param device_id ID of the thermostat device for which you want to create a schedule.
|
|
14
|
+
# @param ends_at Date and time at which the new thermostat schedule ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
|
|
15
|
+
# @param starts_at Date and time at which the new thermostat schedule starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
|
|
16
|
+
# @param is_override_allowed Indicates whether a person at the thermostat or using the API can change the thermostat's settings while the new schedule is active. See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions).
|
|
17
|
+
# @param max_override_period_minutes Number of minutes for which a person at the thermostat or using the API can change the thermostat's settings after the activation of the scheduled climate preset. See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions).
|
|
18
|
+
# @param name Name of the thermostat schedule.
|
|
19
|
+
# @return [Seam::Resources::ThermostatSchedule] OK
|
|
20
|
+
def create(climate_preset_key:, device_id:, ends_at:, starts_at:, is_override_allowed: nil, max_override_period_minutes: nil, name: nil)
|
|
21
|
+
res = @client.post("/thermostats/schedules/create", {climate_preset_key: climate_preset_key, device_id: device_id, ends_at: ends_at, starts_at: starts_at, is_override_allowed: is_override_allowed, max_override_period_minutes: max_override_period_minutes, name: name}.compact)
|
|
22
|
+
|
|
23
|
+
Seam::Resources::ThermostatSchedule.load_from_response(res.body["thermostat_schedule"])
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Deletes a [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats).
|
|
27
|
+
# @param thermostat_schedule_id ID of the thermostat schedule that you want to delete.
|
|
28
|
+
# @return [nil] OK
|
|
29
|
+
def delete(thermostat_schedule_id:)
|
|
30
|
+
@client.post("/thermostats/schedules/delete", {thermostat_schedule_id: thermostat_schedule_id}.compact)
|
|
31
|
+
|
|
32
|
+
nil
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules).
|
|
36
|
+
# @param thermostat_schedule_id ID of the thermostat schedule that you want to get.
|
|
37
|
+
# @return [Seam::Resources::ThermostatSchedule] OK
|
|
38
|
+
def get(thermostat_schedule_id:)
|
|
39
|
+
res = @client.post("/thermostats/schedules/get", {thermostat_schedule_id: thermostat_schedule_id}.compact)
|
|
40
|
+
|
|
41
|
+
Seam::Resources::ThermostatSchedule.load_from_response(res.body["thermostat_schedule"])
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns a list of all [thermostat schedules](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats).
|
|
45
|
+
# @param device_id ID of the thermostat device for which you want to list schedules.
|
|
46
|
+
# @param user_identifier_key User identifier key by which to filter the list of returned thermostat schedules.
|
|
47
|
+
# @return [Seam::Resources::ThermostatSchedule] OK
|
|
48
|
+
def list(device_id:, user_identifier_key: nil)
|
|
49
|
+
res = @client.post("/thermostats/schedules/list", {device_id: device_id, user_identifier_key: user_identifier_key}.compact)
|
|
50
|
+
|
|
51
|
+
Seam::Resources::ThermostatSchedule.load_from_response(res.body["thermostat_schedules"])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Updates a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules).
|
|
55
|
+
# @param thermostat_schedule_id ID of the thermostat schedule that you want to update.
|
|
56
|
+
# @param climate_preset_key Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the thermostat schedule.
|
|
57
|
+
# @param ends_at Date and time at which the thermostat schedule ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
|
|
58
|
+
# @param is_override_allowed Indicates whether a person at the thermostat or using the API can change the thermostat's settings while the schedule is active. See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions).
|
|
59
|
+
# @param max_override_period_minutes Number of minutes for which a person at the thermostat or using the API can change the thermostat's settings after the activation of the scheduled climate preset. See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions).
|
|
60
|
+
# @param name Name of the thermostat schedule.
|
|
61
|
+
# @param starts_at Date and time at which the thermostat schedule starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
|
|
62
|
+
# @return [nil] OK
|
|
63
|
+
def update(thermostat_schedule_id:, climate_preset_key: nil, ends_at: nil, is_override_allowed: nil, max_override_period_minutes: nil, name: nil, starts_at: nil)
|
|
64
|
+
@client.post("/thermostats/schedules/update", {thermostat_schedule_id: thermostat_schedule_id, climate_preset_key: climate_preset_key, ends_at: ends_at, is_override_allowed: is_override_allowed, max_override_period_minutes: max_override_period_minutes, name: name, starts_at: starts_at}.compact)
|
|
65
|
+
|
|
66
|
+
nil
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Seam
|
|
4
|
+
module Clients
|
|
5
|
+
class ThermostatsSimulate
|
|
6
|
+
def initialize(client:, defaults:)
|
|
7
|
+
@client = client
|
|
8
|
+
@defaults = defaults
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Simulates having adjusted the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) for a [thermostat](https://docs.seam.co/capability-guides/thermostats). Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/testing-your-thermostat-app-with-simulate-endpoints).
|
|
12
|
+
# @param device_id ID of the thermostat device for which you want to simulate having adjusted the HVAC mode.
|
|
13
|
+
# @param hvac_mode HVAC mode that you want to simulate.
|
|
14
|
+
# @param cooling_set_point_celsius Cooling [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to simulate. You must set `cooling_set_point_celsius` or `cooling_set_point_fahrenheit`.
|
|
15
|
+
# @param cooling_set_point_fahrenheit Cooling [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to simulate. You must set `cooling_set_point_fahrenheit` or `cooling_set_point_celsius`.
|
|
16
|
+
# @param heating_set_point_celsius Heating [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to simulate. You must set `heating_set_point_celsius` or `heating_set_point_fahrenheit`.
|
|
17
|
+
# @param heating_set_point_fahrenheit Heating [set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to simulate. You must set `heating_set_point_fahrenheit` or `heating_set_point_celsius`.
|
|
18
|
+
# @return [nil] OK
|
|
19
|
+
def hvac_mode_adjusted(device_id:, hvac_mode:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil)
|
|
20
|
+
@client.post("/thermostats/simulate/hvac_mode_adjusted", {device_id: device_id, hvac_mode: hvac_mode, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit}.compact)
|
|
21
|
+
|
|
22
|
+
nil
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Simulates a [thermostat](https://docs.seam.co/capability-guides/thermostats) reaching a specified temperature. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/testing-your-thermostat-app-with-simulate-endpoints).
|
|
26
|
+
# @param device_id ID of the thermostat device that you want to simulate reaching a specified temperature.
|
|
27
|
+
# @param temperature_celsius Temperature in °C that you want simulate the thermostat reaching. You must set `temperature_celsius` or `temperature_fahrenheit`.
|
|
28
|
+
# @param temperature_fahrenheit Temperature in °F that you want simulate the thermostat reaching. You must set `temperature_fahrenheit` or `temperature_celsius`.
|
|
29
|
+
# @return [nil] OK
|
|
30
|
+
def temperature_reached(device_id:, temperature_celsius: nil, temperature_fahrenheit: nil)
|
|
31
|
+
@client.post("/thermostats/simulate/temperature_reached", {device_id: device_id, temperature_celsius: temperature_celsius, temperature_fahrenheit: temperature_fahrenheit}.compact)
|
|
32
|
+
|
|
33
|
+
nil
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|