스마트 홈 작업을 개발하는 방법을 알아볼 수 있는 새로운 공간인 Google Home 개발자 센터에 오신 것을 환영합니다.
의견 보내기
스마트 홈 ColorTemperature 트레잇 스키마
bookmark_border bookmark
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
action.devices.traits.ColorTemperature
- 이 특성은 색상 온도를 설정할 수 있는 모든 기기에 속합니다.
이는 켈빈 색상 포인트를 사용하는 '따뜻한' 전구에 적용됩니다. 이는 일반적으로
ColorSpectrum 과는 별도의 모달리티이며, 온도를 통해 스펙트럼에서 도달할 수 없는 화이트 포인트가 있을 수 있습니다. 사용 가능한 특성에 따라 Google은 요청 및 조명 유형에 따라 사용할 적절한 모드를 선택할 수 있습니다. 예를 들어
거실 조명을 흰색으로 설정 하면 일부 전구에 온도 명령어를 전송하고 LED 스트립으로 스펙트럼 명령어를 전송할 수 있습니다.
기기 ATTRIBUTES
속성
정의
temperatureMinK
선택사항입니다. temperatureMaxK
설정 시 필수입니다. 빛에 의해 지원되는 최소 색 온도(켈빈)입니다.
temperatureMaxK
선택사항입니다. temperatureMinK
설정 시 필수입니다. 조명에 의해 지원되는 최대 색상 온도이며 단위는 켈빈(K)입니다.
샘플 SYNC 요청 및 응답
{ "requestId" : "ff36a3cc-ec34-11e6-b1a0-64510650abcf" , "inputs" : [{ "intent" : "action.devices.SYNC" }] }
'use strict' ; const { smarthome } = require ( 'actions-on-google' ); const functions = require ( 'firebase-functions' ); const app = smarthome (); app. onSync (( body , headers ) => { return { requestId: body . requestId , payload: { agentUserId: '1836.15267389' , devices: [{ id: '123' , type: 'action.devices.types.LIGHT' , traits: [ 'action.devices.traits.ColorTemperature' ], name: { defaultNames: [ 'AAA bulb A19 color hyperglow' ], name: 'lamp1' , nicknames: [ 'reading lamp' ] }, willReportState: true , attributes: { temperatureMinK: 2000 , temperatureMaxK: 6500 }, deviceInfo: { manufacturer: 'AAA' , model: 'hg11' , hwVersion: '1.2' , swVersion: '5.4' }, customData: { fooValue: 12 , barValue: false , bazValue: 'dancing alpaca' } }] } }; }); // ... exports. smarthome = functions . https . onRequest ( app );
{ "requestId" : "ff36a3cc-ec34-11e6-b1a0-64510650abcf" , "payload" : { "agentUserId" : "1836.15267389" , "devices" : [ { "id" : "123" , "type" : "action.devices.types.LIGHT" , "traits" : [ "action.devices.traits.ColorTemperature" ], "name" : { "defaultNames" : [ "AAA bulb A19 color hyperglow" ], "name" : "lamp1" , "nicknames" : [ "reading lamp" ] }, "willReportState" : true , "attributes" : { "temperatureMinK" : 2000 , "temperatureMaxK" : 6500 }, "deviceInfo" : { "manufacturer" : "AAA" , "model" : "hg11" , "hwVersion" : "1.2" , "swVersion" : "5.4" }, "customData" : { "fooValue" : 12 , "barValue" : false , "bazValue" : "dancing alpaca" } } ] } }
기기 상태
상태
정의
color
객체. 현재 색상 설정입니다. 주어진 광원이 스펙트럼 또는 온도 모드에 있으므로 이 객체에는 관련 모드의 현재 색상 설정이 포함됩니다.
name
문자열. 색상 포인트 (스펙트럼 또는 온도)가 파트너의 색상 목록에 있는 미리 설정된 이름과 일치하면 이름을 반환합니다.
temperature
정수. 색상 온도이며 단위는 켈빈(K)입니다.
샘플 QUERY 요청 및 응답
현재 조명 색상 온도는 어떻게 되나요?
{ "requestId" : "ff36a3cc-ec34-11e6-b1a0-64510650abcf" , "inputs" : [{ "intent" : 'action.devices.QUERY' , "payload" : { "devices" : [{ "id" : "123" , "customData" : { "fooValue" : 74 , "barValue" : true , "bazValue" : "foo" } }] } }] }
'use strict' ; const { smarthome } = require ( 'actions-on-google' ); const functions = require ( 'firebase-functions' ); const app = smarthome (); app. onQuery (( body , headers ) => { return { requestId: body . requestId , payload: { devices: { 123 : { online: true , color: { name: 'warm white' , temperature: 25000 }, status: 'SUCCESS' } } } }; }); // ... exports. smarthome = functions . https . onRequest ( app );
{ "requestId" : "ff36a3cc-ec34-11e6-b1a0-64510650abcf" , "payload" : { "devices" : { "123" : { "online" : true , "color" : { "name" : "warm white" , "temperature" : 25000 }, "status" : "SUCCESS" } } } }
기기 명령어
명령어
매개변수/정의
action.devices.commands.ColorAbsolute
color
객체입니다. 필수 항목입니다. RGB 또는 온도와 선택적으로 이름을 포함합니다.
name
문자열. 사용자 명령어에 제공된 색상 이름 (영어) 항상 사용할 수 있는 것은 아닙니다 (상대적 명령의 경우).
temperature
정수. 색상 온도이며 단위는 켈빈(K)입니다.
샘플 EXECUTE 요청 및 응답
조명을 부드러운 흰색으로 조정해 줘.
{ "requestId" : "ff36a3cc-ec34-11e6-b1a0-64510650abcf" , "inputs" : [{ "intent" : "action.devices.EXECUTE" , "payload" : { "commands" : [{ "devices" : [{ "id" : "123" , "customData" : { "fooValue" : 74 , "barValue" : true , "bazValue" : "sheepdip" } }], "execution" : [{ "command" : "action.devices.commands.ColorAbsolute" , "params" : { "color" : { "name" : "soft white" , "temperature" : 2700 } } }] }] } }] }
'use strict' ; const { smarthome } = require ( 'actions-on-google' ); const functions = require ( 'firebase-functions' ); const app = smarthome (); app. onExecute (( body , headers ) => { return { requestId: body . requestId , payload: { commands: [{ ids: [ '123' ], status: 'SUCCESS' , states: { color: { name: 'soft white' , temperature: 2700 } } }] } }; }); // ... exports. smarthome = functions . https . onRequest ( app );
{ "requestId" : "ff36a3cc-ec34-11e6-b1a0-64510650abcf" , "payload" : { "commands" : [ { "ids" : [ "123" ], "status" : "SUCCESS" , "states" : { "color" : { "name" : "soft white" , "temperature" : 2700 } } } ] } }
의견 보내기
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스 에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스 에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책 을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2023-09-21(UTC)
의견을 전달하고 싶나요?
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["잘못된 정보","incorrectInformation","thumb-down"],["정보/샘플이 충분하지 않음","notEnoughInformationSamples","thumb-down"],["너무 복잡함","tooComplicated","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2023-09-21(UTC)"],[],[]]