Skip to content

Commit

Permalink
Merge pull request #4 from Fleker/Fleker-roomnames
Browse files Browse the repository at this point in the history
Adds action to handle rooms said by label
  • Loading branch information
sheppardd1 committed Nov 13, 2018
2 parents 69e31c1 + 624e9c1 commit b554c7a
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 2 deletions.
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

0 comments on commit b554c7a

Please sign in to comment.