From 6b90080a78c143e6dd5ab4cdb0e19c49b96cbad0 Mon Sep 17 00:00:00 2001 From: Mat Sanders Date: Sat, 4 Mar 2017 22:08:55 -0800 Subject: [PATCH 1/3] Create led.php I have made a simple PHP file to work with this python script. Basically gives you a simple web API that can be used to remotely activate it. IE: led.php?led=on led options: on off warm (sets to warm color at 100% unless level is set) [color] (sets to that color) jump [colors] (Does custom pattern jump) gradual [colors] (Does custom pattern gradual) strobe [colors] (Does custom pattern strobe) --- led.php | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 led.php diff --git a/led.php b/led.php new file mode 100644 index 00000000..63d594ef --- /dev/null +++ b/led.php @@ -0,0 +1,47 @@ +&1"); //remover <." 2>&1"> is you get errors in windows. +} +?> From 4aca49f0f9ff89ba6f4cd91babc14ac8032f663a Mon Sep 17 00:00:00 2001 From: Mat Sanders Date: Sat, 4 Mar 2017 22:10:12 -0800 Subject: [PATCH 2/3] Update led.php --- led.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/led.php b/led.php index 63d594ef..17bd0243 100644 --- a/led.php +++ b/led.php @@ -42,6 +42,6 @@ break; } //echo $script." ".$ip." ".$cmd; - echo exec($script." ".$ip." ".$cmd." 2>&1"); //remover <." 2>&1"> is you get errors in windows. + echo exec($script." ".$ip." ".$cmd." 2>&1"); //remove <." 2>&1"> is you get errors in windows. } ?> From 464bceee54d472a6da8fbe4f7bb762c504a8cf99 Mon Sep 17 00:00:00 2001 From: Mat Sanders Date: Sun, 5 Mar 2017 14:11:33 -0800 Subject: [PATCH 3/3] Update led.php Added a option to cycle light on and off. Have it send "on" command when changing modes. Added more output and debug option. --- led.php | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/led.php b/led.php index 17bd0243..4ca9d236 100644 --- a/led.php +++ b/led.php @@ -1,8 +1,8 @@ &1"); //remove <." 2>&1"> is you get errors in windows. + if(isset($_GET['debug'])){echo $script." ".$ip." ".$cmd."
";} + exec($script." ".$ip." ".$cmd." 2>&1",$rtn); + foreach ($rtn as $line){echo $line."
";} } ?>