<commit_before>#pilight

[![Latest Stable Version](https://poser.pugx.org/se/pilight/v/stable.png)](https://packagist.org/packages/se/pilight)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/4c0f1ec0-4bb0-4d3c-a2e1-2302ef1754af/mini.png)](https://insight.sensiolabs.com/projects/4c0f1ec0-4bb0-4d3c-a2e1-2302ef1754af)

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

#### Dev branch is master branch.

[![Build Status](https://api.travis-ci.org/sveneisenschmidt/pilight.png?branch=master)](https://travis-ci.org/sveneisenschmidt/pilight)


##### Table of Contents

1. [Installation](#installation)
2. [Usage](#usage)
    * [Send](#send) 

<a name="installation"></a>
## Installation

The recommended way to install is through [Composer](http://getcomposer.org).

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

### Basic usage
Require the composer autload file and import the namespace.

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

use \SE\Component\Pilight;

```

### Send

```php

$sender =  new Pilight\Sender();
// or set a custom ip and port
$sender =  new Pilight\Sender($host = '172.16.58.3', $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.
```php

$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. In case your *pilight-send* needs to be called via sudo you can get some unexpected output during runtime.<commit_msg>Pilight to lowercase<commit_after>#pilight

[![Latest Stable Version](https://poser.pugx.org/se/pilight/v/stable.png)](https://packagist.org/packages/se/pilight)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/4c0f1ec0-4bb0-4d3c-a2e1-2302ef1754af/mini.png)](https://insight.sensiolabs.com/projects/4c0f1ec0-4bb0-4d3c-a2e1-2302ef1754af)

Library to call [pilight](http://www.pilight.org/) (currently via pilight-send) from php.

#### Dev branch is master branch.

[![Build Status](https://api.travis-ci.org/sveneisenschmidt/pilight.png?branch=master)](https://travis-ci.org/sveneisenschmidt/pilight)


##### Table of Contents

1. [Installation](#installation)
2. [Usage](#usage)
    * [Send](#send) 

<a name="installation"></a>
## Installation

The recommended way to install is through [Composer](http://getcomposer.org).

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

### Basic usage
Require the composer autload file and import the namespace.

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

use \SE\Component\Pilight;

```

### Send

```php

$sender =  new Pilight\Sender();
// or set a custom ip and port
$sender =  new Pilight\Sender($host = '172.16.58.3', $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.
```php

$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. ThisIn case your *pilight-send* needs to be called via sudo you can get some unexpected output during runtime.
{'fraction_non_alphanumeric': 0.16543340380549684, 'fraction_numerical': 0.028012684989429177, 'mean_word_length': 4.525547445255475, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 12, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4951540', 'n_tokens_mistral': 1436, 'n_tokens_neox': 1320, 'n_words': 322}