mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
Rooms And Widget API Endpoints
This commit is contained in:
1 parent
c3f11a4c66
commit
0543f74977
3 files changed
+34
-2
No files matched your search
+12
-1
@@ -3,7 +3,7 @@
|
||||
class RoomsApi extends ApiController{
|
||||
|
||||
public function default(){
|
||||
//$this->requireAuth();
|
||||
$this->requireAuth();
|
||||
$response = [];
|
||||
$roomIds = [];
|
||||
$roomsData = RoomManager::getRoomsDefault();
|
||||
@@ -23,4 +23,15 @@ class RoomsApi extends ApiController{
|
||||
}
|
||||
$this->response($response);
|
||||
}
|
||||
|
||||
public function update($roomId){
|
||||
//$this->requireAuth();
|
||||
|
||||
$subDevicesData = SubDeviceManager::getSubdevicesByRoomIds($roomIds);
|
||||
|
||||
foreach ($roomsData as $roomKey => $roomData) {
|
||||
$response[] = isset($subDevicesData[$roomData['room_id']]) ? $subDevicesData[$roomData['room_id']] : [];
|
||||
}
|
||||
$this->response($response);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user