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 +4 -4
- data/README.md +17 -4
- data/lib/zoney/version.rb +1 -1
- data/lib/zoney/zone.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 620d3f264d893c650256c385b3f00976344870e1d633ab30de283c3e683593aa
|
4
|
+
data.tar.gz: 3609602e8421ac06eb8afd6477d1c0c8ff3400766cd534728e1f0abac9012889
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abd60e16dc1f7db3cefc68740c8e45ae0d028b40a73a4b83a7530b9ea15d96e20051691e03d9e01b09f7f27d9e3c5726bebdeb75b80bc93ff239367c137a5db9
|
7
|
+
data.tar.gz: 3a016a55fe5b627e324d64e3261514c0efcd909138cee164233832e33f8142b986ec4a16a584a8e08d835edb348d40739744496123f433f149b556927e6ef313
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Zoney
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
-
|
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
|
|
data/lib/zoney/version.rb
CHANGED
data/lib/zoney/zone.rb
CHANGED
@@ -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:
|
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: "
|
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: "
|
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:)
|