DAMDA Docs
  • DAMDA Overview
  • Quick Start
    • 개발환경 구성하기
    • Hello DAMDA 따라하기
    • ThinQ 연결하기
    • 내 컴포넌트 로그 확인하기
    • 내 컴포넌트 원격 제어하기
  • FUNDAMENTALS
    • DAMDA 기기
      • DAMDA Installer
        • DAMDA Installer 설치하기
        • DAMDA 설치하기
        • DAMDA 삭제하기
        • DAMDA Installer 삭제하기
      • DAMDA Debugging Console
      • DAMDA Home
        • 기기 등록 하기
        • 기기 등록 해제하기
      • Custom Sub Device
        • Capability
        • Profile
        • Functions
    • DAMDA Cloud
      • 계정 관리
        • 계정 생성하기
        • 기타
      • 컴포넌트 관리
        • DAMDA Components
        • 컴포넌트 초기화하기
        • 컴포넌트 개발하기
        • 컴포넌트 생성하기
        • 컴포넌트 배포하기
    • DAMDA Tools
      • DAMDA CLI
        • Configuration
        • Component
        • Device
        • Deployment
      • DAMDA Simulator
  • REFERENCE
    • API Reference
      • ThinQ API
        • APIs
          • ThinQ 계정 등록
          • 사용자 홈 목록 가져오기
          • 사용자 기기 목록 가져오기
          • 기기 등록하기
          • 기기 정보 가져오기
          • 기기 제어하기
          • 기기 삭제하기
          • 기기 정보 전달하기
        • Error / Exceptions
      • Hub API
        • APIs
          • 지원 기기타입 가져오기
          • 기기 profile 가져오기
          • Capability 가져오기
          • 서브 디바이스 등록하기
          • 서브 디바이스 삭제하기
          • 등록 / 삭제 결과 확인하기
          • 서브 디바이스 리스트 조회
          • 서브 디바이스 정보 조회
          • 서브 디바이스 상태 조회
          • 서브 디바이스 제어
          • 제어 결과 확인
          • 서브 디바이스 상태 모니터링
          • 전체 서브 디바이스 상태 모니터링
        • Types
          • Device
          • DeviceState
      • 가전 API
        • 가전 상태 조회
        • 가전 제어
        • APIs
          • 공통 | Headers
          • 공통 | Response
          • 공통 | Error
          • 가전 목록 조회
          • 가전 상태 조회
          • 가전 Profile 조회
          • 가전 제어
          • EMP Access Token 발급
          • Event/Push Callback (Websocket)
        • Types
          • Device Type
          • Device Profile
      • webOS TV API
        • TV 리스트 조회
        • TV 등록
        • Custom SSAP Command
        • Control
          • ON/OFF
          • Channel
          • Audio
          • App
          • UI 및 기타
        • Remote
        • Subscribe
    • Samples
      • Hello DAMDA
      • ThinQ 연결하기
      • Debugging App
      • 가전 App
      • Proto Sub Device
      • TV화면 캡쳐 + AWS Rekognition
      • DAMDA Hub
Powered by GitBook
On this page
  1. REFERENCE
  2. API Reference
  3. Hub API
  4. Types

DeviceState

기기 상태 정보를 나타내는 타입입니다. 기기가 표현할 수 있는 상태 정보는 capability에서 attributes에 정의되어 있습니다. 각 attribute가 사용할 수 있는 값의 범위 또한 capability에 정의되어있으니 기기 상태를 확인할 때 참고하시기 바랍니다.

기기가 어떤 capability를 갖는지는 기기 profile에 정의되어 있습니다.

capability와 profile에 대한 정의는 각각 Capability, Profile 페이지를 확인해주세요.

상태 정보의 key 값은 [capability의 id].[기기 타입].[attribute]로 구성됩니다.

예를들어 webOSTV에서 사용하는 state정보는 아래와 같습니다.

State Example

{
    "main.webOSTV.volume": 21,
    "main.webOSTV.muted": false
}

Capability Example

참고로 webOSTV의 capability 는 아래와 같이 정의되어 있습니다. capability파일은 언제든지 업데이트 될 수 있으므로, 최신 capability는 damda-hub를 설치한 후 /opt/damda/sub-devices/damda-devices에서 확인하시기 바랍니다

{
    "id": "webOSTV",
    "version": 1,
    "name": "webOS TV",
    "attributes": {
        "power": {
            "schema": {
                "properties": {
                    "value": {
                        "type": "string",
                        "enum": [
                            "on",
                            "off"
                        ]
                    }
                }
            }
        },
        "volume": {
            "schema": {
                "properties": {
                    "value": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100
                    }
                }
            }
        },
        "muted": {
            "schema": {
                "properties": {
                    "value": {
                        "type": "boolean"
                    }
                }
            }
        },
        "programName": {
            "schema": {
                "properties": {
                    "value": {
                        "type": "string"
                    }
                }
            }
        },
        "channelName": {
            "schema": {
                "properties": {
                    "value": {
                        "type": "string"
                    }
                }
            }
        },
        "channelNumber": {
            "schema": {
                "properties": {
                    "value": {
                        "type": "string"
                    }
                }
            }
        }
    },
    "commands": {
        "powerOn": {
            "name": "power_on",
            "arguments": []
        },
        "powerOff": {
            "name": "power_off",
            "arguments": []
        },
        "setVolume": {
            "name": "set_volume",
            "arguments": [
                {
                    "name": "volume",
                    "schema": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100
                    }
                }
            ]
        },
        "keyMute": {
            "name": "mute",
            "arguments": [
                {
                    "name": "mute",
                    "schema": {
                        "type": "boolean"
                    }
                }
            ]
        },
        "volumeUp": {
            "name": "volume_up",
            "arguments": []
        },
        "volumeDown": {
            "name": "volume_down",
            "arguments": []
        },
        "channelUp": {
            "name": "channel_up",
            "arguments": []
        },
        "channelDown": {
            "name": "channel_down",
            "arguments": []
        },
        "keyHome": {
            "name": "home",
            "arguments": []
        },
        "keyBack": {
            "name": "back",
            "arguments": []
        },
        "keyOk": {
            "name": "ok",
            "arguments": []
        },
        "keyLeft": {
            "name": "left",
            "arguments": []
        },
        "keyRight": {
            "name": "right",
            "arguments": []
        },
        "keyUp": {
            "name": "up",
            "arguments": []
        },
        "keyDown": {
            "name": "down",
            "arguments": []
        },
        "capture": {
            "name": "capture",
            "arguments": [
                {
                    "name": "upload_uri",
                    "schema": {
                        "type": "string"
                    }
                }
            ]
        }
    }
}
PreviousDeviceNext가전 API

Last updated 2 years ago