class Tinkerforge::BrickletIndustrialDualRelay

Public Instance Methods

state() click to toggle source

Returns the device's state.

Calls superclass method
# 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