Project

dashed

0.02
No release in over 3 years
Low commit activity in last 3 years
Library for interacting with Amazon Dash buttons
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0

Runtime

~> 0.12.0
 Project Readme

Dashed

Dashed is a Ruby library for interacting with Amazon Dash button presses.

Installation

Just add dashed to your Gemfile and then run bundle install.

Dashed has to be run with root permissions in order to listen to your network devices to pick up your dash button.

Preparing the buttons

In order to use your dash buttons with this library, you will need to set them up using Amazon's setup process. While you can automatically order products using the buttons, if you'd like to prevent the automatic ordering of a product, simply stop the registration process before choosing a product.

It is recommended that you read this post on Medium by Edward Benson describing how he uses the buttons. The article walks you through the process of getting the buttons set up; once you have reached the point that the button is connected through WiFi, this gem will take you the rest of the way!

Usage

Dashed includes the find_dash executable which looks for Amazon Dash buttons based on their mac address. Once you've found your Dash buttons Mac Address you can get started.

ex: sudo find_dash dummylan0 where dummylan0 is the wifi interface to listen on. Ensure your Amazon Dash button is connected to the same network.

Here is an example implementation:

Dashed::Button.new("ff:ff:ff:ff:ff", "dummylan0").on_press do
  puts "I was pressed!"
end

Please be aware that on_press blocks the execution of the current thread. If you don't want it to block please create the button in its own thread.

Known Issues

  • Buttons can not be sniffed out on some OS X machines
  • Some buttons seem to have a different version of the Amazon Dash button software that render them useless for this.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kenyonj/dashed.