New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

str_dn_2030

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

str_dn_2030

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

StrDn2030

TODO: Write a gem description

Installation

gem 'str_dn_2030'
gem 'sinatra' # if you want to use str_dn_2030/web

Or install it yourself as:

$ gem install str_dn_2030

Usage

as a Ruby library

Connect
require 'str_dn_2030'

remote = StrDn2030.new('x.x.x.x') # pass your amp's IP address
remote.connect

zone = remote.zones(0) # main zone
See status
p zone.volume
p zone.powered_on?
p zone.muted?
p zone.headphone?
Control input
input = zone.active_input
p input.name
p input.preset_name

p zone.inputs #=> Hash

zone.inputs['Chrome'].activate!
zone.active_input = zone.inputs['Apple TV']
Control volume
zone.volume = 30
zone.mute = true
zone.mute = false

HTTP interface

# config.ru
require 'str_dn_2030'
require 'str_dn_2030/web'

remote = StrDn2030::Remote.new('x.x.x.x')
remote.connect
StrDn2030::Web.set :remote, remote

run StrDn2030::Web
curl http://localhost:9292/zones/0
curl http://localhost:9292/zones/0/inputs
curl http://localhost:9292/zones/0/volume
curl -X PUT \
     -H 'Content-Type: application/json' \
     -d '{"volume": 25}' \
     http://localhost:9292/zones/0/volume
curl -X PUT \
     -H 'Content-Type: application/json' \
     -d '{"mute": true}' \
     http://localhost:9292/zones/0/volume
curl 'http://localhost:9292/zones/0/inputs/Apple+TV'
curl -X POST 'http://localhost:9292/zones/0/inputs/Apple+TV/activate'
curl http://localhost:9292/zones/0/active
curl -X PUT \
     -H 'Content-Type: application/json' \
     -d '{"input": "Apple TV"}' \
     http://localhost:9292/zones/0/active

Contributing

  1. Fork it ( https://github.com/sorah/str_dn_2030/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

FAQs

Package last updated on 14 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc