pzem016 0.1.0 → 0.1.2

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: '030915a891a9651cde14fcecdca0c8aec9683b3a58fbe36d20913ac5e4603935'
4
- data.tar.gz: b1d4db0b9982a05e173420f63056272ef298eee1bbf3b01a120800589785c50a
3
+ metadata.gz: 463a620a80caa16d7aeb4d8df1cbed92a63f8e39a08f3a92d6cc34e88519bcd9
4
+ data.tar.gz: bc58a7b3096134399252ca017b5c7ec8f12f1edeb4a7c0f9a22c7f0b7e46180f
5
5
  SHA512:
6
- metadata.gz: 72d7704b3335514d3c011c2211022b676c4dd5f5764a4a5a581835fdf714c175b0c5bdc7cbe09b9fc11a2410528f77e09487b18d669304f36654df6a279c96a2
7
- data.tar.gz: 26eeb29d6d1893b83145d791d1c0241af11cacf9679d2878d207732be418713935bbcc15e8489fb9fc0a54f00141b2dbc26d96051a5911bcc26ed6c27cfa995d
6
+ metadata.gz: 2d07c5f715f55bbc14aebe5f6b3ded9e647f3f222c73569676bcdb733c6aba835c1d9505488eec67d293e484b9150a615f406133ba9a0aaca80136398c8f7f77
7
+ data.tar.gz: 450bdf862b01186b46a7269d8cbdfdb092afef2f00fe8835faf9ee5a242fcf35219eeb3b5b2f47bfe6f1c458f6c20c2713cf9b48bce0441bd063eb6f4fb95dd2
data/CHANGELOG CHANGED
@@ -0,0 +1,3 @@
1
+ 0.1.2 - add progress bar, add LICENSE, more doc fixes
2
+ 0.1.1 - doc fixes
3
+ 0.1.0 - initial release
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/README.md CHANGED
@@ -16,15 +16,13 @@ to do that you'll need to look at doing some impedance matching with terminating
16
16
 
17
17
  ## Installation
18
18
 
19
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
20
-
21
19
  Install the gem and add to the application's Gemfile by executing:
22
20
 
23
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
21
+ $ bundle add pzem016
24
22
 
25
23
  If bundler is not being used to manage dependencies, install the gem by executing:
26
24
 
27
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
25
+ $ gem install pzem016
28
26
 
29
27
  ## Usage
30
28
 
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
- print '.'
128
+ # don't care
127
129
  end
128
130
  end
129
131
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pzem016
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.2'
5
5
  end
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.0
4
+ version: 0.1.2
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-23 00:00:00.000000000 Z
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