-
Notifications
You must be signed in to change notification settings - Fork 1
/
inc.config.php
69 lines (63 loc) · 1.88 KB
/
inc.config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/* ===================================================
====== Simple Hue
====== By MILA Yannick - http://www.kouala.org
=================================================== */
# ----------------------------------------------------
# Create User
# Method POST, Return an array
# ----------------------------------------------------
function CreateUser() {
global $server;
global $user;
global $device;
$url = "http://".$server."/api";
$attr = "{\"username\":\"".$user."\",\"devicetype\":\"".$device."\"}";
return LaunchCurl($url,"post",$attr);
}
# ----------------------------------------------------
# Get Configuration
# Method GET, Return an array
# ----------------------------------------------------
function GetConfiguration() {
global $server;
global $user;
$url = "http://".$server."/api/".$user."/config";
$array = LaunchCurl($url);
return $array;
}
# ----------------------------------------------------
# Modify Configuration
# Method PUT, Return an array
# ----------------------------------------------------
function ModifyConfiguration() {
global $server;
global $user;
$url = "http://".$server."/api/".$user."/config";
$attr = "{\"username\":\"".$user."\",\"devicetype\":\"".$device."\"}";
$array = LaunchCurl($url,"put",$attr);
return $array;
}
# ----------------------------------------------------
# Delete User
# Method DELETE, Return an array
# ----------------------------------------------------
function DeleteUser() {
global $server;
global $user;
global $device;
$url = "http://".$server."/api/".$user."/config/whitelist/".$user;
return LaunchCurl($url,"delete");
}
# ----------------------------------------------------
# Get Full State
# Method GET, Return an array
# ----------------------------------------------------
function GetFullState() {
global $server;
global $user;
$url = "http://".$server."/api/".$user;
$array = LaunchCurl($url);
return $array;
}
?>