Introducing the Humble_RPi-plugin-doorlock gem

Usage

require 'humble_rpi-plugin-doorlock.rb'

dl = HumbleRPiPluginDoorLock.new(settings: {pins: [4]})
dl.start
dl.on_doorlock_message 'unlock'

The above example is for testing purposes only.

Using the plugin with Humble_RPi gem

require 'humble_rpi'
require 'humble_rpi-plugin-mtp'

r = HumbleRPi.new device_name: 'sol', sps_address: '192.168.4.140',\
  plugins: {DoorLock: {pins: [4]} }
r.start

As you can see above the named keyword plugins expects a Hash with each item containing a key for the name of the plugin and a value which contains the settings.

Resources