-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d6eb44c
commit d358597
Showing
24 changed files
with
1,253 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Bond YAML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
version: 1 | ||
|
||
api: | ||
name: Bond Home | ||
description: Interfaces with Bond Home bridge | ||
version: 1.0.0 | ||
author: | ||
name: Travis Cox | ||
email: travis@kyvislabs.com | ||
url: https://github.com/Kyvis-Labs/API-YAML/Bond-Home | ||
|
||
variables: | ||
ipAddress: | ||
required: true | ||
token: | ||
required: true | ||
sensitive: true | ||
|
||
headers: | ||
- key: Content-Type | ||
value: application/json | ||
- key: BOND-Token | ||
value: "{{var::token}}" | ||
|
||
functions: | ||
devices: | ||
url: "http://{{var::ipAddress}}/v2/devices" | ||
method: get | ||
schedule: | ||
type: timer | ||
duration: 5 | ||
unit: minutes | ||
actions: | ||
- action: tag | ||
path: "{{var::apiName}}/data" | ||
type: jsonExpand | ||
- action: function | ||
items: "{{jsonPath::$.[*]}}" | ||
function: deviceInfo | ||
variables: | ||
- name: deviceId | ||
value: "{{item | tagPath}}" | ||
- action: function | ||
items: "{{jsonPath::$.[*]}}" | ||
function: deviceState | ||
variables: | ||
- name: deviceId | ||
value: "{{item | tagPath}}" | ||
|
||
deviceInfo: | ||
url: "http://{{var::ipAddress}}/v2/devices/{{var::handler.deviceId}}" | ||
method: get | ||
actions: | ||
- action: tag | ||
path: "{{var::apiName}}/data/{{var::handler.deviceId}}" | ||
type: jsonExpand | ||
|
||
deviceState: | ||
url: "http://{{var::ipAddress}}/v2/devices/{{var::handler.deviceId}}/state" | ||
method: get | ||
actions: | ||
- action: tag | ||
path: "{{var::apiName}}/data/{{var::handler.deviceId}}" | ||
type: jsonExpand | ||
tags: | ||
- name: light | ||
dataType: Int4 | ||
addIfNotExists: false | ||
handler: | ||
function: deviceAction | ||
variables: | ||
- name: action | ||
value: ToggleLight | ||
- name: deviceId | ||
value: "{{var::handler.tagPath | split::[-2]}}" | ||
- name: power | ||
dataType: Int4 | ||
addIfNotExists: false | ||
handler: | ||
function: deviceAction | ||
variables: | ||
- name: action | ||
value: TogglePower | ||
- name: deviceId | ||
value: "{{var::handler.tagPath | split::[-2]}}" | ||
- name: direction | ||
dataType: Int4 | ||
addIfNotExists: false | ||
handler: | ||
function: deviceAction | ||
variables: | ||
- name: action | ||
value: ToggleDirection | ||
- name: deviceId | ||
value: "{{var::handler.tagPath | split::[-2]}}" | ||
- name: speed | ||
dataType: Int4 | ||
addIfNotExists: false | ||
handler: | ||
function: deviceActionValue | ||
variables: | ||
- name: action | ||
value: SetSpeed | ||
- name: deviceId | ||
value: "{{var::handler.tagPath | split::[-2]}}" | ||
|
||
deviceAction: | ||
url: "http://{{var::ipAddress}}/v2/devices/{{var::handler.deviceId}}/actions/{{var::handler.action}}" | ||
method: put | ||
body: | ||
type: json | ||
value: {} | ||
|
||
deviceActionValue: | ||
url: "http://{{var::ipAddress}}/v2/devices/{{var::handler.deviceId}}/actions/{{var::handler.action}}" | ||
method: put | ||
body: | ||
type: json | ||
value: | | ||
{ | ||
"argument": {{var::handler.value}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# DirecTV YAML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
version: 1 | ||
|
||
api: | ||
name: DirecTV | ||
description: Interfaces with DirecTV Genie | ||
version: 1.0.0 | ||
author: | ||
name: Travis Cox | ||
email: travis@kyvislabs.com | ||
url: https://github.com/Kyvis-Labs/API-YAML/DirecTV | ||
|
||
variables: | ||
ipAddress: | ||
required: true | ||
port: | ||
default: 8080 | ||
|
||
headers: | ||
- key: Content-Type | ||
value: application/json | ||
- key: Accept | ||
value: "*/*" | ||
|
||
functions: | ||
locations: | ||
url: "http://{{var::ipAddress}}:{{var::port}}/info/getLocations" | ||
method: get | ||
schedule: | ||
type: timer | ||
duration: 5 | ||
unit: minutes | ||
actions: | ||
- action: tag | ||
path: "{{var::apiName}}/data" | ||
type: jsonExpand | ||
rename: | ||
- items: "{{jsonPath::$.locations[*]}}" | ||
name: "{{jsonPath::item::$.locationName}}" | ||
- action: function | ||
items: "{{jsonPath::$.locations[*]}}" | ||
function: locationTuned | ||
variables: | ||
- name: clientAddr | ||
value: "{{jsonPath::item::$.clientAddr}}" | ||
- name: locationName | ||
value: "{{jsonPath::item::$.locationName}}" | ||
|
||
locationTuned: | ||
url: "http://{{var::ipAddress}}:{{var::port}}/tv/getTuned" | ||
method: get | ||
allowedErrorCodes: | ||
- code: 500 | ||
params: | ||
- name: clientAddr | ||
value: "{{var::handler.clientAddr}}" | ||
actions: | ||
- action: tag | ||
path: "{{var::apiName}}/data/locations/{{var::handler.locationName}}" | ||
type: jsonExpand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Google SDM YAML |
Oops, something went wrong.