w1temp 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/w1temp.rb +6 -0
  2. metadata +1 -1
data/lib/w1temp.rb CHANGED
@@ -4,6 +4,12 @@ class Temperature
4
4
  `sudo modprobe w1-gpio`
5
5
  end
6
6
 
7
+ def name
8
+ paths = Dir["/sys/bus/w1/devices/*"]
9
+ name = paths.select{|path| path.include?('-')}.first.split('/').last
10
+ return name.strip
11
+ end
12
+
7
13
  def reading
8
14
  paths = Dir["/sys/bus/w1/devices/*"]
9
15
  temperature_sensor_path = paths.select{|path| path.include?('-')}.first + '/w1_slave'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: w1temp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: