Class: Tinkerforge::BrickletIndustrialDualRelay

Inherits:
Object
  • Object
show all
Defined in:
lib/tinderfridge/devices/bricklet_industrial_dual_relay/bricklet_industrial_dual_relay.rb

Instance Method Summary collapse

Instance Method Details

#stateObject

Returns the device's state.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/tinderfridge/devices/bricklet_industrial_dual_relay/bricklet_industrial_dual_relay.rb', line 6

def state
  super.merge(
    'relays' => get_value.each_with_index.map do |v,i|
      {
        'value'    => v,
        'output'   => v ? 'A' : 'B',
        'monoflop' => ['time', 'time_remaining'].zip( get_monoflop(i)[1,2] ).to_h,
      }
    end
  )
end