Class: Seam::Clients::DevicesSimulate
- Inherits:
-
Object
- Object
- Seam::Clients::DevicesSimulate
- Defined in:
- lib/seam/routes/devices_simulate.rb
Instance Method Summary collapse
-
#connect(device_id:) ⇒ nil
Simulates connecting a device to Seam.
-
#connect_to_hub(device_id:) ⇒ nil
Simulates bringing the Wi‑Fi hub (bridge) back online for a device.
-
#disconnect(device_id:) ⇒ nil
Simulates disconnecting a device from Seam.
-
#disconnect_from_hub(device_id:) ⇒ nil
Simulates taking the Wi‑Fi hub (bridge) offline for a device.
-
#initialize(client:, defaults:) ⇒ DevicesSimulate
constructor
A new instance of DevicesSimulate.
-
#paid_subscription(device_id:, is_expired:) ⇒ nil
Toggle the simulated Nuki Smart Hosting subscription for a device (sandbox only).
-
#remove(device_id:) ⇒ nil
Simulates removing a device from Seam.
Constructor Details
#initialize(client:, defaults:) ⇒ DevicesSimulate
Returns a new instance of DevicesSimulate.
6 7 8 9 |
# File 'lib/seam/routes/devices_simulate.rb', line 6 def initialize(client:, defaults:) @client = client @defaults = defaults end |
Instance Method Details
#connect(device_id:) ⇒ nil
Simulates connecting a device to Seam. Only applicable for sandbox devices. See also Testing Your App Against Device Disconnection and Removal.
14 15 16 17 18 |
# File 'lib/seam/routes/devices_simulate.rb', line 14 def connect(device_id:) @client.post("/devices/simulate/connect", {device_id: device_id}.compact) nil end |
#connect_to_hub(device_id:) ⇒ nil
Simulates bringing the Wi‑Fi hub (bridge) back online for a device.
Only applicable for sandbox workspaces and currently
implemented for August and TTLock locks.
This will clear the hub_disconnected error on the device.
26 27 28 29 30 |
# File 'lib/seam/routes/devices_simulate.rb', line 26 def connect_to_hub(device_id:) @client.post("/devices/simulate/connect_to_hub", {device_id: device_id}.compact) nil end |
#disconnect(device_id:) ⇒ nil
Simulates disconnecting a device from Seam. Only applicable for sandbox devices. See also Testing Your App Against Device Disconnection and Removal.
35 36 37 38 39 |
# File 'lib/seam/routes/devices_simulate.rb', line 35 def disconnect(device_id:) @client.post("/devices/simulate/disconnect", {device_id: device_id}.compact) nil end |
#disconnect_from_hub(device_id:) ⇒ nil
Simulates taking the Wi‑Fi hub (bridge) offline for a device.
Only applicable for sandbox workspaces and currently
implemented for August, TTLock, and IglooHome devices.
This will set the hub_disconnected error on the device, or mark the
IglooHome bridge offline in sandbox.
48 49 50 51 52 |
# File 'lib/seam/routes/devices_simulate.rb', line 48 def disconnect_from_hub(device_id:) @client.post("/devices/simulate/disconnect_from_hub", {device_id: device_id}.compact) nil end |
#paid_subscription(device_id:, is_expired:) ⇒ nil
Toggle the simulated Nuki Smart Hosting subscription for a device (sandbox only).
Send is_expired: true to simulate an expired subscription, or false to simulate an active subscription.
The actual device error is created/cleared by the poller after this state change.
60 61 62 63 64 |
# File 'lib/seam/routes/devices_simulate.rb', line 60 def paid_subscription(device_id:, is_expired:) @client.post("/devices/simulate/paid_subscription", {device_id: device_id, is_expired: is_expired}.compact) nil end |
#remove(device_id:) ⇒ nil
Simulates removing a device from Seam. Only applicable for sandbox devices. See also Testing Your App Against Device Disconnection and Removal.
69 70 71 72 73 |
# File 'lib/seam/routes/devices_simulate.rb', line 69 def remove(device_id:) @client.post("/devices/simulate/remove", {device_id: device_id}.compact) nil end |