seamapi / seam
Installs: 8 812
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 4
Forks: 3
Open Issues: 15
Requires
- guzzlehttp/guzzle: ^7.5
Requires (Dev)
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.7
- dev-main
- v2.62.0
- v2.61.0
- v2.60.0
- v2.59.0
- v2.58.0
- v2.57.0
- v2.56.0
- v2.55.0
- v2.54.0
- v2.53.0
- v2.52.0
- v2.51.0
- v2.50.0
- v2.49.0
- v2.48.0
- v2.47.0
- v2.46.0
- v2.45.0
- v2.44.0
- v2.43.0
- v2.42.0
- v2.41.0
- v2.40.0
- v2.39.0
- v2.38.0
- v2.37.0
- v2.36.0
- v2.35.0
- v2.34.0
- v2.33.0
- v2.32.0
- v2.31.0
- v2.30.0
- v2.29.0
- v2.28.0
- v2.27.0
- v2.26.0
- v2.25.0
- v2.24.0
- v2.23.0
- v2.22.0
- v2.21.0
- v2.20.0
- v2.19.0
- v2.18.0
- v2.17.0
- v2.16.0
- v2.15.0
- v2.14.0
- v2.13.0
- v2.12.0
- v2.11.0
- v2.10.0
- v2.9.0
- v2.8.0
- v2.7.0
- v2.6.0
- v2.5.0
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.1
- v2.1.0
- v2.0.1
- v2.0.0
- v2.0.0-alpha.0
- v1.1.0
- v1.0.0
- dev-dependabot/npm_and_yarn/seam-5cfb483952
- dev-chrisclark/bump-nextlove-sdk-generator-version-2
- dev-fix-tagging
- dev-fix-online_access_codes_enabled
- dev-setup-for-sdk-generator
- dev-allow-unmanaging-access-codes
- dev-allow-external-modification-when-updating
- dev-allow-external-modification
- dev-add-serial-number
- dev-feat/node-script
- dev-feat/merge-for-workflow-dispatch
- dev-fix/error-code
- dev-andrii-ac-errors-warnings
- dev-andrii-null-params-issues
This package is auto-updated.
Last update: 2024-12-20 03:31:52 UTC
README
Control locks, lights and other internet of things devices with Seam's simple API.
Check out the documentation or the usage below.
Usage
$seam = new Seam\SeamClient("YOUR_API_KEY"); # Create a Connect Webview to login to a provider $connect_webview = $seam->connect_webviews->create( accepted_providers: ["august"] ); print "Please Login at this url: " . $connect_webview->url; # Poll until connect webview is completed while (true) { $connect_webview = $seam->connect_webviews->get( $connect_webview->connect_webview_id ); if ($connect_webview->status == "authorized") { break; } else { sleep(1); } } $connected_account = $seam->connected_accounts->get( $connect_webview->connected_account_id ); print "Looks like you connected with " . json_encode($connected_account->user_identifier); $devices = $seam->devices->list( connected_account_id: $connected_account->connected_account_id ); print "You have " . count($devices) . " devices"; $device_id = $devices[0]->device_id; # Lock a Door $seam->locks->lock_door($device_id); $updated_device = $seam->devices->get($device_id); $updated_device->properties->locked; // true # Unlock a Door $seam->locks->unlock_door($device_id); $updated_device->properties->locked; // false # Create an access code on a device $access_code = $seam->access_codes->create( device_id: $device_id, code: "1234", name: "Test Code" ); # Check the status of an access code $access_code->status; // 'setting' (it will go to 'set' when active on the device) $seam->access_codes->delete($access_code->access_code_id);
Installation
To install the latest version of the automatically generated SDK, run:
composer require seamapi/seam
If you want to install our previous handwritten version, run:
composer require seamapi/seam:1.1
Development Setup
- Run
yarn install
to get prettier installed for formatting - Install composer.
- Run
composer install
in this directory - Run
composer exec phpunit tests
To run a specific test file, do
composer exec phpunit tests/MyTest.php
Running Tests
You'll need to export SEAM_API_KEY
to a sandbox workspace API key.