zoney 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4888d6acf995045b26983198c8ca21ac7aa7bb68aa113c36e744349029c3c8b4
4
- data.tar.gz: 0ee7e1c4a737c21ecf4ba42e5765abadcee62b7e72238b0326df0f025eda4b30
3
+ metadata.gz: 620d3f264d893c650256c385b3f00976344870e1d633ab30de283c3e683593aa
4
+ data.tar.gz: 3609602e8421ac06eb8afd6477d1c0c8ff3400766cd534728e1f0abac9012889
5
5
  SHA512:
6
- metadata.gz: bff26cf32dbbe7e1e36fe8adf394bcf373ba4f5dcea9ae6a44878aec6f0ef2337b2b55981775291140c1730c6fb9432cddc343ac01e1872793f6880cb45cf3c9
7
- data.tar.gz: bd134ccf21b48606d83d8cf23bfc393e08f61fa5ecd4c2f09f9221445dcb8e77e278a2b64e4dedb433a873cdebb619d1aab107a482bd16f150d7479b2fc31c2b
6
+ metadata.gz: abd60e16dc1f7db3cefc68740c8e45ae0d028b40a73a4b83a7530b9ea15d96e20051691e03d9e01b09f7f27d9e3c5726bebdeb75b80bc93ff239367c137a5db9
7
+ data.tar.gz: 3a016a55fe5b627e324d64e3261514c0efcd909138cee164233832e33f8142b986ec4a16a584a8e08d835edb348d40739744496123f433f149b556927e6ef313
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Zoney
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/zoney`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ This gem allows you to communicate with the [MonoPrice 6 Zone
4
+ Amplifier](https://www.monoprice.com/product?p_id=10761) via a serial port
5
+ connection
6
6
 
7
7
  ## Installation
8
8
 
@@ -22,7 +22,20 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ ```ruby
26
+ # Initialize an instance of Zoney::Zone
27
+ zoney = Zoney::Zone.new
28
+
29
+ # This instance is defaulted to 1 amplifier using the /dev/ttyUSB0 port. If you
30
+ # would like to change this you can override these in the initialize call:
31
+ zoney = Zoney::Zone.new(port: "/dev/ttyUSB1", number_of_amplifiers: 3)
32
+
33
+ # Get all the zone information:
34
+ zoney.all
35
+
36
+ # Get a specific zone's information
37
+ zoney.find(zone_number: 14)
38
+ ```
26
39
 
27
40
  ## Development
28
41
 
@@ -1,3 +1,3 @@
1
1
  module Zoney
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -40,7 +40,7 @@ module Zoney
40
40
 
41
41
  def find(zone_number:)
42
42
  data_string = "?#{zone_number}\r\n"
43
- write_data(string: data_string) && sleep(1)
43
+ write_data(string: data_stringr && sleep(1)
44
44
 
45
45
  decoded_response[0]
46
46
  end
@@ -54,11 +54,11 @@ module Zoney
54
54
  end
55
55
 
56
56
  def mute(zone_number:)
57
- update_attribute(zone_number: zone_number, attribute: "mt", value: "01")
57
+ update_attribute(zone_number: zone_number, attribute: "mu", value: "01")
58
58
  end
59
59
 
60
60
  def unmute(zone_number:)
61
- update_attribute(zone_number: zone_number, attribute: "mt", value: "00")
61
+ update_attribute(zone_number: zone_number, attribute: "mu", value: "00")
62
62
  end
63
63
 
64
64
  def change_source(zone_number:, source_number:)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zoney
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Kenyon