2017 © Pedro Peláez
 

library pilight

Library to call Pilight (currently pilight-send) from php.

image

se/pilight

Library to call Pilight (currently pilight-send) from php.

  • Wednesday, December 11, 2013
  • by sveneisenschmidt
  • Repository
  • 2 Watchers
  • 2 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

pilight

Latest Stable Version SensioLabsInsight, (*1)

Library to call pilight (currently via pilight-send) from php., (*2)

Dev branch is master branch.

Build Status, (*3)

Table of Contents
  1. Installation
  2. Usage

, (*4)

Installation

The recommended way to install is through Composer., (*5)

{
    "require": {
        "se/pilight": "dev-master"
    }
}

Basic usage

Require the composer autload file and import the namespace., (*6)

require_once __DIR__.'/vendor/autoload.php';

use \SE\Component\Pilight;

Send


$sender = new Pilight\Sender(); // or set a custom ip and port $sender = new Pilight\Sender($host = '129.168.2.1', $port = 6535); $protocol = 'elro'; $arguments = array( 's' => 31, 'u' => 1, ); $device = new Pilight\Device($protocol, $arguments); // or add the arguments later via setArguments $device->setArguments($arguments); // turn it on $device->addArgument('t'); // send it! $sender->send($device);

If you need root permissions to call pilight-send, call setSudo(true) on $sender., (*7)


$sender->setSudo(true); $sender->send($device);

You can add the pilight-send executable to your sudoers configuration to make it callable via sudo without the need to enter a password. This is in case your pilight-send needs to be called via sudo rights you can get some unexpected output during runtime if setting it not., (*8)

$ sudo nano /etc/sudoers.d/pilight

Contents:, (*9)

www-data ALL= NOPASSWD: /usr/local/sbin/pilight-send
pi ALL= NOPASSWD: /usr/local/sbin/pilight-send
<REPLACE YOU USER> ALL= NOPASSWD: /usr/local/sbin/pilight-send

The Versions

11/12 2013

dev-master

9999999-dev https://github.com/sveneisenschmidt/pilight

Library to call Pilight (currently pilight-send) from php.

  Sources   Download

MIT

The Requires

 

The Development Requires

gpio wiringpi pilight wiredpi

11/12 2013

v0.1-beta

0.1.0.0-beta https://github.com/sveneisenschmidt/pilight

Library to call Pilight (currently pilight-send) from php.

  Sources   Download

MIT

The Requires

 

The Development Requires

gpio wiringpi pilight wiredpi