pzem016 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +2 -0
- data/LICENSE +21 -0
- data/exe/pzem016.rb +3 -1
- data/lib/pzem016/pzem016.rb +2 -0
- data/lib/pzem016/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 893bb8b964fcd2cc4c17f7c82bd4f838114d9d832448e40b8e3281f3b322cd43
|
4
|
+
data.tar.gz: f78d11aac4f41c84f6b2e251fbcd12e52c764bed8bd6c4c83edab3c48541a255
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ad416faf49bbabc006a33489702d53810407846ac43f81bd1c03731006f5ac7f9d6cbdac72125e008363e94f5ccb14f78865cbdd064180071ef04feb1f288fb
|
7
|
+
data.tar.gz: 32188e79a095f20a3c75349c534850ee1b962a4f85d173c06e84191b0c538a9962d79e1013df09e8df1bd6bd41069fe1677784411be9bc06b56749b9c5c7dd3f
|
data/CHANGELOG
CHANGED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 svdasein
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/exe/pzem016.rb
CHANGED
@@ -108,9 +108,11 @@ begin
|
|
108
108
|
puts "Slave at addr #{cmd_opts[:sladdr]} energy counter reset: #{Pzem016::HoldingRegisters.new(global_opts[:name],
|
109
109
|
bus.with_slave(cmd_opts[:sladdr])).reset_energy}"
|
110
110
|
when :scanbus
|
111
|
+
progress = ProgressBar.create(title: "sladdr", total: 247,length: 80,format: '%t %c/%C (%j%): |%B|' )
|
111
112
|
begin
|
112
113
|
(1..247).each do |address|
|
113
114
|
bus.with_slave(address) do |slave|
|
115
|
+
progress.increment
|
114
116
|
slave.read_retry_timeout = global_opts[:timeout]
|
115
117
|
slave.read_retries = global_opts[:retries]
|
116
118
|
begin
|
@@ -123,7 +125,7 @@ begin
|
|
123
125
|
puts
|
124
126
|
end
|
125
127
|
rescue StandardError
|
126
|
-
|
128
|
+
# don't care
|
127
129
|
end
|
128
130
|
end
|
129
131
|
end
|
data/lib/pzem016/pzem016.rb
CHANGED
@@ -94,6 +94,7 @@ module Pzem016
|
|
94
94
|
#
|
95
95
|
def to_hash
|
96
96
|
{
|
97
|
+
"SlaveAddr": @slave.uid,
|
97
98
|
"DeviceName": @name,
|
98
99
|
"Address": @raw[2],
|
99
100
|
"AlarmWatts": @raw[1]
|
@@ -168,6 +169,7 @@ module Pzem016
|
|
168
169
|
#
|
169
170
|
def to_hash
|
170
171
|
{
|
172
|
+
"SlaveAddr": @slave.uid,
|
171
173
|
"DeviceName": @name,
|
172
174
|
"Volts": volts,
|
173
175
|
"Amps": amps,
|
data/lib/pzem016/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pzem016
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Parker
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -77,6 +77,7 @@ extensions: []
|
|
77
77
|
extra_rdoc_files: []
|
78
78
|
files:
|
79
79
|
- CHANGELOG
|
80
|
+
- LICENSE
|
80
81
|
- PZEM016-bench.jpg
|
81
82
|
- README.md
|
82
83
|
- Rakefile
|