Akıllı Ev Renk Sıcaklığı Özellik Şeması
Bu özellik kullanımdan kaldırıldı. Bunun yerine ColorSettings 'i kullanın.
action.devices.traits.ColorTemperature
: Bu özellik, renk sıcaklığını ayarlayabilecek tüm cihazlara aittir.
Bu, Kelvin'de renk noktası alan "ılık" ampuller için geçerlidir. Bu genellikle
ColorSpectrum 'dan ayrı bir yöntemdir ve Sıcaklık üzerinden ulaşılabilen ve Spectrum'dan erişilemeyen beyaz noktalar olabilir. Mevcut özelliklere bağlı olarak Google, isteğe ve ışık türüne göre uygun modu seçebilir (örneğin,
oturma odasının ışıklarını beyaz yapma , bazı ampullere Sıcaklık komutları ve LED bantlarına Spectrum komutları gönderebilir).
Cihaz ATTRIBUTES
Özellik
Tanım
temperatureMinK
İsteğe bağlı. temperatureMaxK
ayarlanmışsa zorunludur. Kelvin cinsinden ışık tarafından desteklenen minimum renk sıcaklığı.
temperatureMaxK
İsteğe bağlı. temperatureMinK
ayarlanmışsa zorunludur. Kelvin cinsinden ışık tarafından desteklenen maksimum renk sıcaklığı.
Örnek SYNC İsteği ve Yanıtı
{
"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"
}
}
]
}
}
Cihaz STATUS
Eyalet
Tanım
color
Nesne. Geçerli renk ayarı. Belirli bir ışık spektrum VEYA sıcaklık modunda olduğu için bu nesne, alakalı moddaki geçerli renk ayarlarını içerir.
name
Dizesi. Renk noktası (Spektrum veya Sıcaklık) iş ortağının renk listesindeki önceden belirlenmiş bir adla eşleşirse adı iade edin.
temperature
Tam sayı. Kelvin cinsinden renk sıcaklığı.
Örnek QUERY İsteği ve Yanıtı
Mevcut açık renk sıcaklığım nedir?
{
"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"
}
}
}
}
Cihaz Komisyonları
Komut
Parametreler/Tanımlar
action.devices.commands.ColorAbsolute
color
Nesne. Zorunlu. RGB veya sıcaklık ve isteğe bağlı olarak bir ad içerir.
name
Dizesi. Kullanıcının komutunda sağlanan renk adı (İngilizce). Her zaman kullanılamaz (göreli komutlar için).
temperature
Tam sayı. Kelvin cinsinden renk sıcaklığı.
Örnek Yürütme İsteği ve Yanıtı
Işıkımı yumuşak beyaz olarak ayarla.
{
"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
}
}
}
]
}
}