@@ -196,15 +196,15 @@ After a My2N account is linked with Seam, you can retrieve devices for this My2N
196196
197197{% tabs %}
198198{% tab title="Python" %}
199- \`\`\`\` python all\_ locks = seam.locks.list()
200-
201- some\_ lock = all\_ locks\[ 0]
199+ ``` python
200+ all_locks = seam.locks.list()
202201
203- assert some \_ lock.properties \[ "online" ] is True assert some \_ lock.properties \[ "locked" ] is True
202+ some_lock = all_locks[ 0 ]
204203
205- print(some\_ lock)
204+ assert some_lock.properties[" online" ] is True
205+ assert some_lock.properties[" locked" ] is True
206206
207- ``` python
207+ print (some_lock)
208208# Device(
209209# device_id='f0c074d6-34d0-4910-a16a-dfe078d5d178',
210210# device_type='two_n_intercom',
@@ -228,9 +228,9 @@ print(some\_lock)
228228# )
229229```
230230
231- \ { % endtab %\ }
231+ {% endtab %}
232232
233- \ { % tab title="Javascript" %\ }
233+ {% tab title="Javascript" %}
234234
235235``` javascript
236236const allLocks = await seam .locks .list ()
@@ -267,22 +267,42 @@ console.log(someLock)
267267*/
268268```
269269
270- \ { % endtab %\ }
270+ {% endtab %}
271271
272- \ { % tab title="Ruby" %\ }
272+ {% tab title="Ruby" %}
273273
274274``` ruby
275275some_lock = seam.locks.list.first
276276
277277puts some_lock.properties.online # true
278278puts some_lock.properties.locked # true
279279
280- puts some_lock.inspect # > # warnings=[] # errors=[] # created_at=2023-05-03 18:01:16.965 UTC # } # "image_alt_text"=>"Placeholder Lock Image" # "image_url"=>"https://connect.getseam.com/assets/images/devices/unknown-lock.png", # "name"=>"Device 0", # "supported_code_lengths"=>[4, 5, 6, 7, 8], # }, # "device_name"=>"Device 0" # "device_id"=>1, # "two_n_metadata"=>{ # "serial_number"=>"ef730e77-8cc0-4290-a818-14388e9fe84f", # "manufacturer"=>"two_n", # "locked"=>true, # "online"=>true, # properties={ # device_type="two_n_intercom" # device_id="580365be-4f0f-42d9-9336-07f0bba09e28" # <Seam::Device:0x00c8bb8
280+ puts some_lock.inspect
281+ # <Seam::Device:0x00c8bb8
282+ # device_id="580365be-4f0f-42d9-9336-07f0bba09e28"
283+ # device_type="two_n_intercom"
284+ # properties={
285+ # "online"=>true,
286+ # "locked"=>true,
287+ # "manufacturer"=>"two_n",
288+ # "serial_number"=>"ef730e77-8cc0-4290-a818-14388e9fe84f",
289+ # "two_n_metadata"=>{
290+ # "device_id"=>1,
291+ # "device_name"=>"Device 0"
292+ # },
293+ # "supported_code_lengths"=>[4, 5, 6, 7, 8],
294+ # "name"=>"Device 0",
295+ # "image_url"=>"https://connect.getseam.com/assets/images/devices/unknown-lock.png",
296+ # "image_alt_text"=>"Placeholder Lock Image"
297+ # }
298+ # created_at=2023-05-03 18:01:16.965 UTC
299+ # errors=[]
300+ # warnings=[]
281301```
282302
283- \ { % endtab %\ }
303+ {% endtab %}
284304
285- \ { % tab title="PHP" %\ }
305+ {% tab title="PHP" %}
286306
287307``` php
288308use Seam\SeamClient;
@@ -294,13 +314,15 @@ $locks = $seam->locks->list();
294314echo json_encode($locks);
295315```
296316
297- \ { % endtab %\} \ { % endtabs %\ }
317+ {% endtab %} {% endtabs %}
298318
299319#### 4 — Locking & Unlocking a Door
300320
301321Next, you can perform the basic action of locking and unlocking the door.
302322
303- \{ % openapi src="../../.gitbook/assets/openapi.json" path="/locks/lock\_ door" method="post" %\} [ openapi.json] ( ../../.gitbook/assets/openapi.json ) \{ % endopenapi %\}
323+ {% openapi src="../.gitbook/assets/openapi.json" path="/locks/lock_door" method="post" %}
324+ [ openapi.json] ( ../.gitbook/assets/openapi.json )
325+ {% endopenapi %}
304326
305327#### Unlock a door
306328
@@ -312,7 +334,7 @@ Next, you can perform the basic action of locking and unlocking the door.
312334| ---------- | ------ | ----------- |
313335| device\_ id | String | |
314336
315- \ { % tabs %\} \ { % tab title="Python" %\ }
337+ {% tabs %} {% tab title="Python" %}
316338
317339``` python
318340# lock the door
@@ -326,9 +348,9 @@ updated_lock = seam.locks.get(device_id: some_lock.device_id)
326348assert updated_lock.properties[" locked" ] is False
327349```
328350
329- \ { % endtab %\ }
351+ {% endtab %}
330352
331- \ { % tab title="Javascript" %\ }
353+ {% tab title="Javascript" %}
332354
333355``` javascript
334356// lock the door
@@ -342,9 +364,9 @@ updatedLock = await seam.locks.get(someLock.device_id)
342364console .log (updatedLock .properties .locked ) // false
343365```
344366
345- \ { % endtab %\ }
367+ {% endtab %}
346368
347- \ { % tab title="Ruby" %\ }
369+ {% tab title="Ruby" %}
348370
349371``` ruby
350372# lock the door
@@ -358,9 +380,9 @@ updated_lock = seam.locks.get(device_id: some_lock.device_id)
358380puts updated_lock.properties.locked # false
359381```
360382
361- \ { % endtab %\ }
383+ {% endtab %}
362384
363- \ { % tab title="PHP" %\ }
385+ {% tab title="PHP" %}
364386
365387``` php
366388use Seam\SeamClient;
@@ -375,15 +397,15 @@ $seam->locks->unlock_door($lock->device_id);
375397$seam->locks->lock_door($lock->device_id);
376398```
377399
378- \ { % endtab %\} \ { % endtabs %\ }
400+ {% endtab %} {% endtabs %}
379401
380402#### 5 — Creating Access Codes on 2N Intercoms
381403
3824042N devices have a directory with residents. These residents can be assigned PIN codes to unlock the door.
383405
384406Seam maps these residents to [ access codes] ( https://docs.seam.co/latest/capability-guides/smart-locks/access-codes ) and allows you to create and manage them through the Seam API.
385407
386- \ { % tabs %\} \ { % tab title="Python" %\ }
408+ {% tabs %} {% tab title="Python" %}
387409
388410``` python
389411# create an ongoing code
@@ -419,9 +441,9 @@ seam.access_codes.list(device=some_lock)
419441
420442```
421443
422- \ { % endtab %\ }
444+ {% endtab %}
423445
424- \ { % tab title="Javascript" %\ }
446+ {% tab title="Javascript" %}
425447
426448``` javascript
427449// create an ongoing code
@@ -465,9 +487,9 @@ await seam.accessCodes.list({
465487*/
466488```
467489
468- \ { % endtab %\ }
490+ {% endtab %}
469491
470- \ { % tab title="Ruby" %\ }
492+ {% tab title="Ruby" %}
471493
472494``` ruby
473495# create an ongoing code
@@ -515,9 +537,9 @@ seam.access_codes.list(device_id: some_lock.device_id)
515537# access_code_id="91a08a3d-a0bb-4ff0-bfb4-ced164353988">]
516538```
517539
518- \ { % endtab %\ }
540+ {% endtab %}
519541
520- \ { % tab title="PHP" %\ }
542+ {% tab title="PHP" %}
521543
522544```
523545
0 commit comments