承接 guym4c/kasa-plug-client 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

guym4c/kasa-plug-client

Composer 安装命令:

composer require guym4c/kasa-plug-client

包简介

TP-Link Kasa API client

README 文档

README

A simple client for the TP-Link Kasa smart plugs.

Install

Via Composer:

composer install guym4c/kasa-plug-client

Usage

Get yourself an instance of the client, using your TP-Link Cloud login details (which you use to log in to the app).

$kasa = new \Guym4c\Kasa\Client(/* username */, /* password */);

As tokens for the unofficial Kasa API expire quite fast, the package takes your credentials and obtains a new token for you on every instantiation.

What you're here for

Turning plugs on and off is simple - you can retrieve a Plug using the $kasa->getPlug() method. Pass this method a string of the plug alias or plug ID (you can see the alias in the Kasa app, or get a list of your plugs using getPlugs()).

Then just call $plug->setState(bool) with true for on, and false for off. (You can get the current state of the plug's relay using the status property of each Plug).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固