From 42d0ed8b2d4c0a878e7bc8af0e0988d39a8b4ffc Mon Sep 17 00:00:00 2001 From: samilliken Date: Thu, 23 Jul 2015 08:59:24 -0400 Subject: [PATCH] Did a lookup on DeviceCustomAttributes so that we return that name rather than the index on device lookups. Fixed #629 --- api/v1/index.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/v1/index.php b/api/v1/index.php index 031e2a3e9..993ad69ad 100644 --- a/api/v1/index.php +++ b/api/v1/index.php @@ -401,6 +401,16 @@ function authenticate(\Slim\Route $route) { $response['message']=__("No device found with DeviceID").$deviceid; echoResponse(404,$response); }else{ + if ( is_array( $dev->CustomValues ) ) { + $cattr = new DeviceCustomAttribute(); + $newList = array(); + foreach ( $dev->CustomValues as $key=>$val ) { + $cattr->AttributeID = $key; + $cattr->GetDeviceCustomAttribute(); + $newList[$cattr->Label] = $val; + } + $dev->CustomValues = $newList; + } $response['error']=false; $response['errorcode']=200; $response['device']=$dev;