Download the PHP package williamson/tplinksmartplug without Composer

On this page you can find all versions of the php package williamson/tplinksmartplug. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tplinksmartplug

PHP Library to Control and Access a TP-Link Smartplug!

Smart Plug
Build Status Total Downloads Latest Stable Version License

(Bonus Laravel integration supported!!)

TPLink Smartplug is a small PHP library that allows anyone to control and access a TPLink Smartplug.

Current TPLINK models supported are

It is likely that other TPLink models will also work, but these have not been checked.

Installation

This package can be installed standalone in a regular PHP project, or can also be integrated into Laravel to make life even easier.

To install the latest version simply use composer to add it to your project using the following command:

Laravel Installation/Integration

This library supports Laravel's auto discovery feature for auto registering the service provider and facade. If your version of Laravel supports auto discovery, after you have added this package YOU ARE NOW DONE!

If you are using a very old version of Laravel, once this package is installed, you need to register the package's service provider, in config/app.php:

Facades

Only if your version of Laravel does NOT support auto discovery then add the following to the aliases section of 'app.php'.

Config file

This package requires a config file so that you can provide the address/details of the TPLink devices you would like to control. To generate this file, run the following command:

This will create a TPLink.php file in your Laravel config folder. You should edit this to setup your devices.

Configuration

The config file is a very simple array structured file. A config file is required for both standalone/Laravel projects. The content is similar to this:

You may add as many devices as you wish, as long as you specify the IP address (or host address if required) and port number to access each one. Giving each device a name makes it easy to identify them when coding later. (Please note that the name you give here does NOT have to match the actual name you might have assigned the device using an official app like Kasa. They do NOT have to match)

Usage

You can access your device either through the TPLinkManager class (especially useful if you have multiple devices), or directly using the TPLinkDevice class.

Using the manager, allows you to specify WHICH device you would like to send your command to.

If you only have one device you may just want to use the TPDevice class by itself - but using the manager is recommended.

Depending on your style of coding you may use either the Facade or instantiate the object yourself.

The following are all similar:

Once you have your device ready, you can then send it a command.

Commands

All commands for the smartplug have been created in a separate class to ease use and allow for more to be added easily in the future.

To send a command, simply call the sendCommand method on the TPDevice object and pass in the command required as a parameter.

For example, to get the current status of the smartplug

If a command requires a parameter, provide that as well:

Toggle Power

There is one command that is called directly on the TPLinkDevice and that is the togglePower() method.

If you only wish to toggle the current power state of the plug, use it as follows:

There are a large number of commands in the TPLinkCommand class. Please read the docblock comments for explanations and requirements for each one.

The current list of commands available to use are:

Additional information

Any issues, feedback, suggestions or questions please use issue tracker here.

Credits

Disclaimer

This project and its author is neither associated, nor affiliated with TP-LINK in anyway. See License section for more details.

License

This project is released under the MIT License.

© 2017 Jonathan Williamson, All rights reserved.


All versions of tplinksmartplug with dependencies

PHP Build Version
Package Version
Requires tightenco/collect Version ^5.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package williamson/tplinksmartplug contains the following files

Loading the files please wait ....