Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/derzombiiie/yamaha-node

A nodejs implementation of a protocol used by YAMAHAs AV Controller Android app
https://github.com/derzombiiie/yamaha-node

libary nodejs yamaha-av-receiver

Last synced: 16 days ago
JSON representation

A nodejs implementation of a protocol used by YAMAHAs AV Controller Android app

Awesome Lists containing this project

README

        

# Yamaha-node

A implementation of some obscure-ish YAMAHA protocol, found in the "AV Controller" App for Android

## How to use

```js
// import the library
const {Host} = require("./yamaha-node.js")

// create a Host object
var MyHost = new Host("")

// list of all available "features" or functions
MyHost.features

// get a specific feature by its name
MyHost.features.find("")

// get the state of a feature
let feature = MyHost.features.find("")
// do the request
MyHost.getFeature(feature).then(data => {
// you can (for all features) just use the default .toString() method to get a human friendly name for the feature
console.log(data.toString())
})

// set the state of a feature
feature = MyHost.features.find("")
// do the request
MyHost.setFeature(feature, "").then(res => { // state can be a string or number depending on what the feature is
console.log(res) // if res === "0", then success all other values are unknown errors
})
```

working examples can be found in `test.js`

## Documentation of the Definition format: (definition.json)

```json
{
"endpoint": "", // endpoint for all port requests
"features": [
{
"name": "", // the name of your feature
"type": "", // type of input see "types" part of documentation
"values": {}, // see "types"
"mult": aN, // see "types"
"setRequest": {
"data": "" // the raw string send to the reciver, ${data} gets replaced with value
},
"locationGet": {
"location": [], // see "location"
"sReqId": "" // Request ID
}
},
]

"requests": {
"": {
"cacheTime": aN, // time in ms a cache is valid
"data": "" // raw string send to the reciver
}
}
}
```

### types

Possible types are:

- toggle
```json
"type": "toggle",
"values": {
"tName": ""
"fName": ""
},
"mult": null
```

- range
```json
"type": "range",
"values": {
"max": ,
"min": ,
"step":
}
"mult":
```

- input
```json
"type": "input",
"values": [
{
"tName": "",
"fName": "",
"desc": "Description of input"
}
],
"mult": null
```

### location

A array of elements usually separated by 0s

for example the power location looks like:

```json
["YAMAHA_AV", "Main_Zone", 0, "Basic_Status", 0, "Power_Control", 0 "Power", 0]
```