Skip to content

Commit e91da76

Browse files
committed
Bugfixing general.php
1 parent 517bb61 commit e91da76

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

general.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

33
//require_once('ikea-smart-home.config.php');
4-
require_once('define.php');
4+
require_once('defines.php');
55

66
class tradfri
77
{
88

9-
privat $gateway;
9+
private $gateway;
1010

1111
function __construct($user, $secret, $gwip){
1212

@@ -18,7 +18,7 @@ function __construct($user, $secret, $gwip){
1818

1919
function query($path){
2020

21-
$cmd = "coap-client -m get -u '{$gateway['user']}' -k '{$gateway['secretkey']}' 'coaps://{$gateway['ip']}:5684/{$path}'";
21+
$cmd = "coap-client -m get -u '{$this->gateway['user']}' -k '{$this->gateway['secretkey']}' 'coaps://{$this->gateway['ip']}:5684/{$path}'";
2222
$process = proc_open($cmd, [STDOUT => ['pipe', 'w'], STDERR => ['pipe', 'w']], $output);
2323

2424
//read the outputs
@@ -39,7 +39,7 @@ function query($path){
3939
}
4040

4141
function action($method, $payload, $path){
42-
$cmd = "coap-client -m {$method} -u '{$gateway['user']}' -k '{$gateway['secretkey']}' -e '{$payload}' 'coaps://{$gateway['ip']}:5684/{$path}'";
42+
$cmd = "coap-client -m {$method} -u '{$this->gateway['user']}' -k '{$this->gateway['secretkey']}' -e '{$payload}' 'coaps://{$this->gateway['ip']}:5684/{$path}'";
4343
exec($cmd);
4444

4545
}

0 commit comments

Comments
 (0)