diff --git a/api.php b/api.php index 41b0db6..6f34015 100644 --- a/api.php +++ b/api.php @@ -190,6 +190,8 @@ if ($values != null || $values != "") { 'device' => [ 'hostname' => $hostname, 'ipAddress' => $device['ip_address'], + 'subnet' => $device['subnet'], + 'gateway' => $device['gateway'], ], 'state' => 'succes', ]; @@ -225,6 +227,8 @@ if ($values != null || $values != "") { 'hostname' => $device['name'], 'sleepTime' => $device['sleep_time'], 'ipAddress' => $device['ip_address'], + 'subnet' => $device['subnet'], + 'gateway' => $device['gateway'], ], 'state' => 'succes', 'value' => $subDeviceLastReordValue diff --git a/app/class/RoomManager.php b/app/class/RoomManager.php index 6c71c24..f5f4bd9 100644 --- a/app/class/RoomManager.php +++ b/app/class/RoomManager.php @@ -3,8 +3,8 @@ class RoomManager{ public static $rooms; function getDefaultRoomId() { - $defaultRoom = Db::loadOne("SELECT id FROM rooms WHERE default = 1"); - return $defaultRoom['id']; + $defaultRoom = Db::loadOne("SELECT room_id FROM rooms WHERE 'default' = 1"); + return $defaultRoom['room_id']; } function getAllRooms () { diff --git a/app/views/Home.php b/app/views/Home.php index 6afa75c..2231ba3 100644 --- a/app/views/Home.php +++ b/app/views/Home.php @@ -158,6 +158,8 @@ class Home extends Template 'token' => $deviceData['token'], 'type' => $deviceData['type'], 'ip' => $deviceData['ip_address'], + 'subnet' => $deviceData['subnet'], + 'gateway' => $deviceData['gateway'], 'sleepTime' => $deviceData['sleep_time'], 'approved' => $deviceData['approved'], 'permission' => $permissionArray,