domotics-arduino 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,33 +1,30 @@
1
- # Digital pin
2
- module Domotics
3
- module Arduino
4
- module DigitalPin
1
+ module Domotics::Arduino
2
+ module DigitalPin
5
3
 
6
- def initialize(args_hash = {})
7
- @board = Domotics::Device[args_hash[:device]]
8
- @pin = args_hash[:pin]
9
- @board.register_pin self, @pin
10
- super
11
- end
4
+ def initialize(args = {})
5
+ @board = Domotics::Device[args[:device]]
6
+ @pin = args[:pin]
7
+ @board.register_pin self, @pin
8
+ super
9
+ end
12
10
 
13
- def state!
14
- to_hls @board.get_digital(@pin)
15
- end
11
+ def state!
12
+ to_hls @board.get_digital(@pin)
13
+ end
16
14
 
17
- def set_state(value)
18
- @board.set_digital @pin, to_lls(value)
19
- super
20
- end
15
+ def set_state(value)
16
+ @board.set_digital @pin, to_lls(value)
17
+ super
18
+ end
21
19
 
22
- # Convert to High Level State
23
- def to_hls(value)
24
- value == ArduinoBase::HIGH ? :on : :off
25
- end
20
+ # Convert to High Level State
21
+ def to_hls(value)
22
+ value == ArduinoBase::HIGH ? :on : :off
23
+ end
26
24
 
27
- # Convert to Low Level State
28
- def to_lls(value)
29
- value == :on ? ArduinoBase::HIGH : ArduinoBase::LOW
30
- end
25
+ # Convert to Low Level State
26
+ def to_lls(value)
27
+ value == :on ? ArduinoBase::HIGH : ArduinoBase::LOW
31
28
  end
32
29
  end
33
30
  end
@@ -1,15 +1,11 @@
1
- #!/usr/bin/ruby -w
2
- # coding: utf-8
3
- module Domotics
4
- module Arduino
5
- # Normal_close sensor
6
- module NCSensor
7
- include DigitalPin
8
- def initialize(args_hash = {})
9
- super
10
- @board.set_input_pullup @pin
11
- @board.set_watch @pin, ArduinoBase::WATCHON
12
- end
1
+ module Domotics::Arduino
2
+ # Normal_close sensor
3
+ module NCSensor
4
+ include DigitalPin
5
+ def initialize(args = {})
6
+ super
7
+ @board.set_input_pullup @pin
8
+ @board.set_watch @pin, ArduinoBase::WATCHON
13
9
  end
14
10
  end
15
11
  end
@@ -1,12 +1,9 @@
1
- module Domotics
2
- module Arduino
3
- # Normal_open sensor
4
- module NOSensor
5
- include DigitalPin
6
- def initialize(args_hash = {})
7
- super
8
- @board.set_watch @pin, ArduinoBase::WATCHON
9
- end
1
+ module Domotics::Arduino
2
+ module NOSensor
3
+ include DigitalPin
4
+ def initialize(args = {})
5
+ super
6
+ @board.set_watch @pin, ArduinoBase::WATCHON
10
7
  end
11
8
  end
12
9
  end
@@ -1,5 +1,5 @@
1
1
  module Domotics
2
2
  module Arduino
3
- VERSION = "0.3.3"
3
+ VERSION = "0.3.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domotics-arduino
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-04 00:00:00.000000000 Z
12
+ date: 2014-01-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: serialport