냉난방기 원격 제어
매장의 냉난방기를 원격으로 조회하고 제어하는 API입니다. HomeAssistant를 통해 IR 리모컨 신호를 전송합니다.
제어 옵션 조회
GET /admin/airconditioner/{branch}
지점에서 사용 가능한 냉난방 제어 옵션을 트리 구조로 반환합니다. 리프 노드의 airconditioner_id를 제어 실행 API에 전달합니다.
Headers
| 이름 | 필수 | 설명 |
|---|---|---|
Cookie | O | 관리자 세션 쿠키 |
Path Parameters
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
branch | String | O | 지점 영문명 (지점 코드 참고) |
GET /api/admin/airconditioner/Gwanghwamun
Response
- 200 성공
- 403 권한 없음
트리 구조로 모드 → 온도 → 풍량 → 풍향 순으로 중첩됩니다. 최종 리프 노드에 airconditioner_id가 포함됩니다.
{
"status": "success",
"errorType": null,
"errorCode": null,
"message": null,
"data": [
{
"name": "냉방",
"children": [
{
"name": "18℃",
"children": [
{
"name": "풍량 자동",
"airconditioner_id": "ac_gwang_cool_18_auto",
"children": null
},
{
"name": "풍량 강",
"airconditioner_id": "ac_gwang_cool_18_high",
"children": null
}
]
}
]
},
{
"name": "난방",
"children": [
{
"name": "24℃",
"children": [
{
"name": "풍량 자동",
"airconditioner_id": "ac_gwang_heat_24_auto",
"children": null
}
]
}
]
},
{
"name": "전원 끄기",
"airconditioner_id": "ac_gwang_off",
"children": null
}
]
}
트리 노드
| 필드 | 타입 | Nullable | 설명 |
|---|---|---|---|
name | String | N | 옵션명 (모드/온도/풍량/풍향) |
airconditioner_id | String | Y | 제어 실행 ID (리프 노드만) |
children | Array | Y | 하위 옵션 (리프 노드는 null) |
{
"status": "error",
"errorType": "AuthorizationException",
"errorCode": null,
"message": "해당 지점에 접근 권한이 없습니다.",
"data": null
}
제어 실행
POST /admin/airconditioner/{airconditioner_id}
조회에서 받은 ID로 냉난방 명령을 실행합니다. HomeAssistant에 IR 리모컨 신호를 전송합니다.
Headers
| 이름 | 필수 | 설명 |
|---|---|---|
Cookie | O | 관리자 세션 쿠키 |
Path Parameters
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
airconditioner_id | String | O | 제어 옵션 ID (조회의 리프 노드에서 확인) |
POST /api/admin/airconditioner/ac_gwang_cool_18_auto
Response
- 200 성공
- 403 권한 없음
{
"status": "success",
"errorType": null,
"errorCode": null,
"message": null,
"data": null
}
{
"status": "error",
"errorType": "AuthorizationException",
"errorCode": null,
"message": "해당 지점에 접근 권한이 없습니다.",
"data": null
}