giannisftaras/smartthings 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

giannisftaras/smartthings

Composer 安装命令:

composer require giannisftaras/smartthings

包简介

A PHP wrapper for the Samsung Smart Things API

README 文档

README

This library is a simple PHP wrapper for the Smart Things API. At the moment the library utilizes only a single endpoint from the API since I don't have all the devices listed to test it with. If you want support for more devices you can implement your own calls & functions and create a pull request to merge it to the main branch. For the API calls the GuzzleHTTP library is used as a dependency and is already included in the main package.

Supported devices:

  • TV

Installation:

You can install the library using composer or by simply downloading this repository and including it in your project. Installation using composer:

composer require giannisftaras/smartthings

Usage:

Follow the instructions at the Smart Things Developer page on how to create a Personal Access (Bearer) Token for authenticating with the API. Then you can use the following code for testing:

<?php
 require  __DIR__  .  '/../vendor/autoload.php';
 use SmartThings\SmartThingsAPI; 
      
 # Create a Personal Access Token and add it below
 $userBearerToken = '<<TOKEN>>';
 $smartAPI = new SmartThingsAPI($userBearerToken);
 $devices = $smartAPI->list_devices(); 
      
 $tv = $devices[0];
 $tv->power_on();
 $tv->volume(10);
?>

You can view the TV class in /src/smartThings/devices/tv.php for all available functions and commands.

You can also make a basic usage of Locations and Rooms:

$location = new SmartThings\Locations('<<LOCATION_ID>>');
$location->get_rooms();

$room = new SmartThings\Room('<<ROOM_ID>>');
$room->name();

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2021-12-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固