Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds action to handle rooms said by label #4

Merged
merged 2 commits into from Nov 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -57,3 +57,4 @@ freeline_project_description.json

# A backup file of old custom actions file
actions - OLD*
creds.data
71 changes: 70 additions & 1 deletion CustomCommands/actions.json
Expand Up @@ -51,7 +51,7 @@
{
"deviceExecution": {
"command": "com.acme.commands.Room_Number",
"params": {
"params": {
"number": "$number"
}
}
Expand All @@ -60,6 +60,75 @@
}
}
}
},
{
"name": "com.acme.actions.Room_Name",
"availability": {
"deviceClasses": [
{
"assistantSdkDevice": {}
}
]
},
"intent": {
"name": "com.acme.intents.Room_Name",
"parameters": [
{
"name": "name",
"type": "RoomName"
}
],
"trigger": {
"queryPatterns": [
"Where is (room)? $RoomName:name",
"How do I get to (room)? $RoomName:name"
]
}
},
"fulfillment": {
"staticFulfillment": {
"templatedResponse": {
"items": [
{
"deviceExecution": {
"command": "com.acme.commands.Room_Name",
"params": {
"name": "$name"
}
}
}
]
}
}
}
}
],
"types": [
{
"name": "$RoomName",
"entities": [
{
"key": "346",
"synonyms": [
"office",
"E C E office"
]
},
{
"key": "306",
"synonyms": [
"bathroom",
"womans bathroom"
]
},
{
"key": "100",
"synonyms": [
"atrium",
"commons area"
]
}
]
}
]
}
1 change: 0 additions & 1 deletion CustomCommands/creds.data

This file was deleted.

Expand Up @@ -332,6 +332,13 @@ public void onClick(View view) {
} catch (IOException e) {
Log.e(TAG, "Cannot set value of LED", e);
}
} else if (intentName.equals("com.acme.commands.Room_Name")) {
try {
String room = parameters.getString("name");
Log.d(TAG, "Looking for Room_Name: Room: " + room);
} catch (JSONException e) {
Log.e(TAG, "Cannot get value of command", e);
}
}
}
})
Expand Down