CandyHouseのSesameスマートロックAPIを利用するためのライブラリです。
This library is for using the sesame3 smart lock API.
※ OpenSSL Crypto library (ext-crypto) is required.
※準備中
$ composer require chanshige/sesame
<?php
// initialize
use Chanshige\SmartLock\Action;
use Chanshige\SmartLock\Sesame;
$uuid = '488ABAAB-164F-7A86-595F-DDD778CB86C3'; // Sesameデバイス固有のID
$secretKey = 'a13d4b890111676ba8fb36ece7e94f7d' // デバイスを操作するための鍵
$sesame = Sesame::newInstance('sesame-api-key');
$response = $sesame($uuid, new Action\Status());
$response = $sesame($uuid, new Action\History());
// 鍵をかける
$response = $sesame($uuid, new Action\Lock($secretKey, 'chanshigeが鍵かけた'));
// 鍵をあける
$response = $sesame($uuid, new Action\UnLock($secretKey, 'chanshigeが鍵あけた'));
// 鍵をひたすら回す
$response = $sesame($uuid, new Action\Toggle($secretKey, 'chanshigeが操作した'));
$ composer tests
Feel free to create issues and submit pull requests. For any PR submitted, make sure it is covered by tests or include new tests.
If you discover any security related issues, please email author email instead of using the issue tracker.
MIT