Skip to content

Commit 8b45ca1

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

1 file changed

Lines changed: 52 additions & 30 deletions

File tree

docs/brand-guides/2n-intercom-systems/get-started-with-2n-intercoms.md

Lines changed: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -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
236236
const 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
275275
some_lock = seam.locks.list.first
276276

277277
puts some_lock.properties.online # true
278278
puts 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
288308
use Seam\SeamClient;
@@ -294,13 +314,15 @@ $locks = $seam->locks->list();
294314
echo json_encode($locks);
295315
```
296316

297-
\{% endtab %\} \{% endtabs %\}
317+
{% endtab %} {% endtabs %}
298318

299319
#### 4 — Locking & Unlocking a Door
300320

301321
Next, 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)
326348
assert 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)
342364
console.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)
358380
puts updated_lock.properties.locked # false
359381
```
360382

361-
\{% endtab %\}
383+
{% endtab %}
362384

363-
\{% tab title="PHP" %\}
385+
{% tab title="PHP" %}
364386

365387
```php
366388
use 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

382404
2N devices have a directory with residents. These residents can be assigned PIN codes to unlock the door.
383405

384406
Seam 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

Comments
 (0)