From 29f5a460f87988e3a0760d5ffb88c42e68ddfe68 Mon Sep 17 00:00:00 2001 From: Kalyax Date: Mon, 14 Nov 2022 17:12:59 +0100 Subject: [PATCH] route update et nettoyage code --- .gitignore | 1 + api/get_light.php | 6 ++++++ api/{temp.php => get_temp.php} | 0 api/set_light.php | 2 +- scripts/get_light.sh | 4 ++++ scripts/led.sh | 13 ------------- scripts/set_light.sh | 5 +++++ scripts/toto | 1 - test.php | 5 ----- toto | 1 - 10 files changed, 17 insertions(+), 21 deletions(-) create mode 100644 .gitignore create mode 100644 api/get_light.php rename api/{temp.php => get_temp.php} (100%) create mode 100755 scripts/get_light.sh delete mode 100755 scripts/led.sh create mode 100755 scripts/set_light.sh delete mode 100644 scripts/toto delete mode 100644 test.php delete mode 100644 toto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2b0fc6c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +test.php \ No newline at end of file diff --git a/api/get_light.php b/api/get_light.php new file mode 100644 index 0000000..1be95bb --- /dev/null +++ b/api/get_light.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/api/temp.php b/api/get_temp.php similarity index 100% rename from api/temp.php rename to api/get_temp.php diff --git a/api/set_light.php b/api/set_light.php index 1dccee8..2d8bb44 100644 --- a/api/set_light.php +++ b/api/set_light.php @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/scripts/get_light.sh b/scripts/get_light.sh new file mode 100755 index 0000000..c4a1b1f --- /dev/null +++ b/scripts/get_light.sh @@ -0,0 +1,4 @@ +#!/bin/bash +gpio mode $1 out +let "out=`gpio read $1`" +echo $out diff --git a/scripts/led.sh b/scripts/led.sh deleted file mode 100755 index 6449958..0000000 --- a/scripts/led.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -echo $1 -gpio mode $1 out -let "out=`gpio read $1`" -echo $out -if [ $out = 1 ] -then - gpio write $1 0 - echo 0 -else - gpio write $1 1 - echo 1 -fi diff --git a/scripts/set_light.sh b/scripts/set_light.sh new file mode 100755 index 0000000..0f13e3a --- /dev/null +++ b/scripts/set_light.sh @@ -0,0 +1,5 @@ +#!/bin/bash +gpio mode $1 out +let "out=`gpio read $1`" +gpio write $1 $out +echo $out diff --git a/scripts/toto b/scripts/toto deleted file mode 100644 index 573541a..0000000 --- a/scripts/toto +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/test.php b/test.php deleted file mode 100644 index 61147d4..0000000 --- a/test.php +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/toto b/toto deleted file mode 100644 index 573541a..0000000 --- a/toto +++ /dev/null @@ -1 +0,0 @@ -0