This repository has been archived on 2019-03-01. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
paper-pi/app/Paper/InteractiveMenu.php
2019-02-27 21:44:55 +01:00

43 lines
995 B
PHP

<?php
namespace App\Paper;
class InteractiveMenu
{
private $apiKey;
private $paper;
private $redis;
private $structure = [
0 =>
[
'title' => 'tytuł pierwszego menu',
1 => ['name' => 'to jest podtytuł pierwszego menu', 'action' => '', 'type' => 'output'],
2 => ['name' => 'to jest podtytuł drugiego menu', 'action' => '', 'type' => 'input'],
3 => ['name' => 'to jest podtytuł trzeciego menu', 'action' => '', 'type' => 'outputandinput'],
4 => ['name' => 'to jest podtytuł czwartego menu', 'action' => '', 'type' => 'inputandoutput'],
]
];
public function __construct()
{
$this->paper = new Paper();
$this->redis = new \Redis();
$this->redis->connect('127.0.0.1', 6379);
$this->redis->setex('interactivemenu', 10, 1);
}
public function pressed($key)
{
$this->paper->sendPrint($key);
}
}