Skip to content

Commit 0d30302

Browse files
louis-preclaude
andcommitted
Fix code formatting and escaped GitBook tags in ControlByWeb guide
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8b45ca1 commit 0d30302

1 file changed

Lines changed: 39 additions & 32 deletions

File tree

docs/brand-guides/get-started-with-controlbyweb-devices.md

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ After a ControlByWeb account is linked with Seam, you can retrieve devices for t
163163

164164
{% tabs %}
165165
{% tab title="Python" %}
166-
\`\`\`\`python all\_locks = seam.locks.list()
167-
168-
some\_lock = all\_locks\[0]
166+
```python
167+
all_locks = seam.locks.list()
169168

170-
assert some\_lock.properties\["online"] is True assert some\_lock.properties\["locked"] is True
169+
some_lock = all_locks[0]
171170

172-
print(some\_lock)
171+
assert some_lock.properties["online"] is True
172+
assert some_lock.properties["locked"] is True
173173

174-
```python
174+
print(some_lock)
175175
# Device(
176176
# device_id='4a570d13-9704-46e0-b69c-9fea80d6a7aa',
177177
# device_type='controlbyweb_device',
@@ -193,7 +193,9 @@ print(some\_lock)
193193
# errors=[]
194194
# )
195195
```
196+
{% endtab %}
196197

198+
{% tab title="Javascript" %}
197199
```javascript
198200
const allLocks = await seam.locks.list()
199201

@@ -230,19 +232,38 @@ console.log(someLock)
230232
}
231233
*/
232234
```
235+
{% endtab %}
233236

234-
235-
237+
{% tab title="Ruby" %}
236238
```ruby
237239
some_lock = seam.locks.list.first
238240

239241
puts some_lock.properties.online # true
240242
puts some_lock.properties.locked # true
241243

242-
puts some_lock.inspect # > # warnings=[] # errors=[] # created_at=2023-04-25 14:34:50 UTC # } # "image_alt_text"=>"Placeholder Lock Image" # "image_url"=>"https://connect.getseam.com/assets/images/devices/unknown-lock.png", # "name"=>"Device 2", # }, # "device_name"=>"Device 2" # "relay_name"=>"firstRelay", # "device_id"=>"9997", # "controlbyweb_metadata"=>{ # "manufacturer"=>"controlbyweb", # "online"=>true, # "locked"=>true, # properties={ # device_type="controlbyweb_device" # device_id="4a570d13-9704-46e0-b69c-9fea80d6a7aa" # <Seam::Device:0x00146639380
244+
puts some_lock.inspect
245+
# <Seam::Device:0x00146639380
246+
# device_id="4a570d13-9704-46e0-b69c-9fea80d6a7aa"
247+
# device_type="controlbyweb_device"
248+
# properties={
249+
# "locked"=>true,
250+
# "online"=>true,
251+
# "manufacturer"=>"controlbyweb",
252+
# "controlbyweb_metadata"=>{
253+
# "device_id"=>"9997",
254+
# "relay_name"=>"firstRelay",
255+
# "device_name"=>"Device 2"
256+
# },
257+
# "name"=>"Device 2",
258+
# "image_url"=>"https://connect.getseam.com/assets/images/devices/unknown-lock.png",
259+
# "image_alt_text"=>"Placeholder Lock Image"
260+
# }
261+
# created_at=2023-04-25 14:34:50 UTC
262+
# errors=[]
263+
# warnings=[]
243264
```
244-
245-
\{% endtab %\} \{% endtabs %\}
265+
{% endtab %}
266+
{% endtabs %}
246267

247268
**4 — Triggering a ControlByWeb relay**
248269

@@ -258,40 +279,26 @@ Next, you can perform the basic action of triggering a relay on the device. This
258279
| ---------- | ------ | ----------- |
259280
| device\_id | String | |
260281

261-
\{% tabs %\} \{% tab title="Python" %\}
262-
282+
{% tabs %}
283+
{% tab title="Python" %}
263284
```python
264285
# trigger the relay
265286
seam.locks.unlock_door(some_lock)
266287
```
288+
{% endtab %}
267289

268-
\{% endtab %\}
269-
270-
\{% tab title="Javascript" %\}
271-
290+
{% tab title="Javascript" %}
272291
```javascript
273292
// trigger the relay
274293
await seam.locks.unlockDoor(someLock.device_id)
275294
```
295+
{% endtab %}
276296

277-
\{% endtab %\}
278-
279-
\{% tab title="Ruby" %\}
280-
281-
```
282-
283-
ruby
297+
{% tab title="Ruby" %}
298+
```ruby
284299
# trigger the relay
285300
seam.locks.unlock_door(device_id: some_lock.device_id)
286301
```
287-
{% endtab %}
288-
289-
{% tab title="Javascript" %}
290-
291-
{% endtab %}
292-
293-
{% tab title="Ruby" %}
294-
295302
{% endtab %}
296303
{% endtabs %}
297304

0 commit comments

Comments
 (0)