Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dkuku/node-frontier-silicon
js connector for frontier silicon radios
https://github.com/dkuku/node-frontier-silicon
Last synced: 2 months ago
JSON representation
js connector for frontier silicon radios
- Host: GitHub
- URL: https://github.com/dkuku/node-frontier-silicon
- Owner: dkuku
- License: other
- Created: 2020-03-08T08:24:52.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-25T11:02:10.000Z (over 2 years ago)
- Last Synced: 2024-04-21T01:24:08.625Z (9 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# node-frontier-silicon
JS implementation of the Frontier Silicon API
- This project is is a direct port of zhelev/python-fsapi (https://github.com/zhelev/python-fsapi) using metapensiero/metapensiero.pj (https://github.com/metapensiero/metapensiero.pj)
# Required node libs:
```
npm install node-fetch xml-js --save
```Usage
=====```js
const Fsapi = require('node-frontier-silicon');const URL = 'http://192.168.1.151:80/device'
const PIN = 1234
const TIMEOUT = 1 // in secondsconst fs = new FSAPI(URL, PIN, TIMEOUT)
run()
async function run(){
await fs.init()
await fs.get_mode_list().then(e=>console.log(e))
await fs.get_mode().then(e=>console.log(e))
await fs.get_play_status().then(e=>console.log(e))
await fs.get_play_info_text().then(e=>console.log(e))
await fs.get_play_info_artist().then(e=>console.log(e))
await fs.get_play_info_album().then(e=>console.log(e))
await fs.get_play_info_graphics().then(e=>console.log(e))
await fs.get_volume_steps().then(e=>console.log(e))
await fs.disconnect().then(e=>console.log(e))
}
```
This results in:
```
# node example.js[ 'Internet radio',
'TIDAL',
'Napster',
'Deezer',
'Qobuz',
'Spotify',
'DMR',
'Music player',
'AUX in' ]
Deezer
playing
Search and Destroy (Iggy Pop Mix)
Iggy & the Stooges
Raw Power
http://assets.airable.io/600x600/jpeg:80/aHR0cHM6Ly9jZG5zLWltYWdlcy5kemNkbi5uZXQvaW1hZ2VzL2NvdmVyLzRhMTQyMmRhOGIyYWM3MjYzNzNmZjRlNWYxZDUwMTE1LzUwMHg1MDAtMDAwMDAwLTgwLTAtMC5qcGc/
21
true
```