I tried to use example code from codelab and modified device type for pratice. When I tried to add a Fan device to google smart home app,I got an error response.
Ex: (ask:Set the fan to speed low) (response:OK,descreasing Fan speed to speedslow.)
app.onSync(async (body, headers) => {
console.log('onSync');
return {
requestId: body.requestId,
payload: {
agentUserId: agentId,
devices: [{
id: 'fan',
type: 'action.devices.types.FAN',
traits: [
'action.devices.traits.OnOff',
'action.devices.traits.FanSpeed',
//'action.devices.traits.Mode',
],
name: {
name: 'Fan',
},
deviceInfo: {
manufacturer: 'AAA',
model: 'BBB-Fan1',
hwVersion: '1.0',
swVersion: '1.0.1',
},
willReportState: true,
attributes: {
availableFanSpeeds: {
speeds: [{
speed_name: 'Low',
speed_values: [{
speed_synonym: ['speedslow','speedlow','speedsmall','slow','low','small','minimum'],
lang: 'en'
}]
},{
speed_name: 'Medium',
speed_values: [{
speed_synonym: ['medium','speed medium'],
lang: 'en'
}]
},{
speed_name: 'High',
speed_values: [{
speed_synonym: ['speed fast','speed high','speed big','fast','high','big','maximum'],
lang: 'en'
}]
}],
ordered: true
},
reversible: true,
Q1: The 'speedslow' is my speed_synonym below the speed_name 'Low'. I think that it need to response the answer like 'OK,descreasing Fan speed to Low'.Right?
Q2: In traits page,it has not support Chinese language. I found that I could use some Chinese words to control device behavior like 'Open the Fan' in Chinese language through google assistant app. But I also found that I couldn't use some Chinese words like 'Set fan speed to low' to change my device state.So it seems Chinese language doesn't support right?