From d5949332f462bea96a4f94840121011f0f00a64d Mon Sep 17 00:00:00 2001 From: Brendon Irwin Date: Tue, 16 Aug 2016 19:43:43 -0400 Subject: [PATCH] Added stub page for getting device/room information --- images/info.png | Bin 0 -> 419 bytes index.php | 4 ++-- info.php | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 images/info.png create mode 100644 info.php diff --git a/images/info.png b/images/info.png new file mode 100644 index 0000000000000000000000000000000000000000..4dcc170ca9d971e3d19547be047c88206cf66210 GIT binary patch literal 419 zcmV;U0bKrxP)Cp2Il9Sd+(gN(=myOZ~~8UO->&sD%*zv&R`A4O! zMNV5dt8QN6UW~<#y6NK`p5Rm=p2nvr`;eTT7u7t(JZ38_1nK%uaf`2E+^g`S#7%t1 zg^s#e#~wM&+70UFDWGf_}d2eK% zk82;5(`fQDE#Z>Z+!saW9_rX%!R76rX?vy_EaGqo$1gR+s+``G^dGGiX>VuE_96fP N002ovPDHLkV1gBi!ifL? literal 0 HcmV?d00001 diff --git a/index.php b/index.php index 76cd858..5ffe4fd 100644 --- a/index.php +++ b/index.php @@ -56,7 +56,7 @@ foreach($DATA as $room){ echo '
'; - echo '

'.$room["name"].'

'; + echo '

'.$room["name"].'

'; $DEVICES = array(); @@ -87,7 +87,7 @@ echo '
'; //power > 0 then enabled //level = brightness //state = on or off - echo '

'.$device['name'].'

'; + echo '

'.$device['name'].'

'; echo ' | '; echo '
'; echo '

Brightness:

'; diff --git a/info.php b/info.php new file mode 100644 index 0000000..c27d01e --- /dev/null +++ b/info.php @@ -0,0 +1,38 @@ +Device Info'; + echo '

Device ID:'.$did.'

'; + $CMD = "cmd=DeviceGetInfo&data=1".TOKEN."".$did."name,power,product,class,image,control,realtype,other,status"; + + $result = getCurlReturn($CMD); + $array = xmlToArray($result); + if( isset( $array["image"] ) && ! is_array( $array["image"]) ){ + echo '

'; + } + + pa( $array ); + +} + +if( isset($_REQUEST['rid']) && $_REQUEST['rid'] != "" ){ + $rid = $_REQUEST['rid']; + echo '

Room Information

'; + echo '

Room ID:'.$rid.'

'; + + $CMD = "cmd=RoomGetInfoAll&data=1".TOKEN."".$rid."name,power,product,class,image,imageurl,control,other"; + + $result = getCurlReturn($CMD); + $array = xmlToArray($result); + + pa( $array ); +} +?> \ No newline at end of file