a15lam/php-wemo

PHP 库,用于控制 Wemo 设备。

0.2.2 2017-06-10 17:44 UTC

This package is auto-updated.

Last update: 2024-08-29 04:36:45 UTC


README

PHP 库,用于控制 Wemo 设备。

当前支持...

  1. Wemo 灯泡 - 开/关/调光
  2. Wemo 开关 - 开/关
  3. Wemo 开关(插座) - 开/关
  4. Wemo 智能开关 - 开/关/参数
  5. 设备发现
  6. Wemo 桥接器下的分组设备

入门

git clone https://github.com/a15lam/php-wemo.git
cd php-wemo
composer update
php example/console.php   // An example command line app to control your wemo devices.

使用方法

$lightSwitch = \a15lam\PhpWemo\Discovery::getDeviceByName('Bed Room Light'); // Use your wemo device name as they show on your wemo app. Supports grouped devices
$lightSwitch->On();
sleep(2); // Allow a moment to see the light turning on.
$lightSwitch->Off();
// Get switch status
echo $lightSwitch->status();

查看示例目录获取更多使用方法。通过命令行运行 example/console.php 以控制您的设备。