Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nigelramsay/wemo

An Elixir package for discovering and controlling Belkin Wemo devices
https://github.com/nigelramsay/wemo

belkin elixir wemo wemo-switch

Last synced: 2 months ago
JSON representation

An Elixir package for discovering and controlling Belkin Wemo devices

Awesome Lists containing this project

README

        

# Wemo

Elixir package for discovering and controlling Belkin Wemo devices.

[![Build Status](https://travis-ci.org/nigelramsay/wemo.svg?branch=master)](https://travis-ci.org/nigelramsay/wemo)

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `wemo` to your list of dependencies in `mix.exs`:

```elixir
def deps do
[{:wemo, "~> 0.1.0"}]
end
```

## Usage examples

Searching for a specific switch:

```elixir-lang
Wemo.Switch.find_by_name("Laundry") |> Switch.status
=> {:ok, 1}
```

Turning a switch on and off:

```elixir-lang
living_room = Wemo.Switch.find_by_name("Living Room")
Switch.on(living_room)
=> {:ok, 1}

Switch.off(living_room)
=> {:ok, 0}
```

Checking the status of a switch:

```elixir-lang
Wemo.Switch.on?(living_room)
=> true

Wemo.Switch.off?(living_room)
=> true

Wemo.Switch.status(living_room)
=> 1
```