Skip to content

Commit

Permalink
Initial YAML configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
iatraviscox committed Jan 24, 2023
1 parent d6eb44c commit d358597
Show file tree
Hide file tree
Showing 24 changed files with 1,253 additions and 0 deletions.
1 change: 1 addition & 0 deletions bond/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Bond YAML
122 changes: 122 additions & 0 deletions bond/config.yaml
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}}
}
1 change: 1 addition & 0 deletions directv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# DirecTV YAML
59 changes: 59 additions & 0 deletions directv/config.yaml
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
1 change: 1 addition & 0 deletions google_sdm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Google SDM YAML
Loading

0 comments on commit d358597

Please sign in to comment.